auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static LabelType initCodeReviewLabel(ProjectConfig c) { LabelType type = new LabelType("Code-Review", ImmutableList.of( new LabelValue((short) 2, "Looks good to me, approved"), new LabelValue((short) 1, "Looks good to me, but someone else must approve"), new LabelValue((short) 0, "No score"), new LabelValue((short) -1, "I would prefer this is not merged as is"), new LabelValue((short) -2, "This shall not be merged"))); type.setAbbreviation("CR"); type.setCopyMinScore(true); <START> type.setDefaultValue(new LabelValue((short) 0, "No Score")); <END> c.getLabelSections().put(type.getName(), type); return type; }</code><technical_language>necessary; default default is 0</technical_language>

Target:
public static LabelType initCodeReviewLabel(ProjectConfig c) { LabelType type = new LabelType("Code-Review", ImmutableList.of( new LabelValue((short) 2, "Looks good to me, approved"), new LabelValue((short) 1, "Looks good to me, but someone else must approve"), new LabelValue((short) 0, "No score"), new LabelValue((short) -1, "I would prefer this is not merged as is"), new LabelValue((short) -2, "This shall not be merged"))); type.setAbbreviation("CR"); type.setCopyMinScore(true); c.getLabelSections().put(type.getName(), type); return type; }
Source:
<code>protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { super.decodeLast(ctx, in, out); if (in.readableBytes() > 0) { String discardedData = in.readBytes(in.readableBytes()).toString(Charset.forName("UTF-8")); if (StringUtils.isNotBlank(discardedData)) { <START> logger.warning("Client " + PortUnificationHandler.getRemoteName(ctx) + " disconnected, leaving unterminated " + <END> "string. Input (" + in.readableBytes() + " bytes) discarded: \"" + discardedData + "\""); } } }</code><technical_language>here, break 2 lines</technical_language>

Target:
protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { super.decodeLast(ctx, in, out); if (in.readableBytes() > 0) { String discardedData = in.readBytes(in.readableBytes()).toString(Charset.forName("UTF-8")); if (StringUtils.isNotBlank(discardedData)) { logger.warning("Client " + PortUnificationHandler.getRemoteName(ctx) + " disconnected, leaving unterminated string. Input (" + in.readableBytes() + " bytes) discarded: \"" + discardedData + "\""); } } }
Source:
<code>public void setUp() { try { customMapsDirectory.newFolder(testMapNameGenerator); fafDataDirectory.newFolder(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY); Files.createFile(fafDataDirectory.getRoot().toPath().resolve(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY).resolve(String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), versionGeneratorPresent))); <START> } catch (IOException e) { <END> e.printStackTrace(); throw new RuntimeException("Could not create test map generator folder!"); } when(preferencesService.getFafDataDirectory()).thenReturn(fafDataDirectory.getRoot().toPath()); when(preferencesService.getPreferences()).thenReturn(preferences); when(preferences.getForgedAlliance()).thenReturn(forgedAlliancePrefs); when(forgedAlliancePrefs.getCustomMapsDirectory()).thenReturn(customMapsDirectory.getRoot().toPath()); instance = new MapGeneratorService(applicationContext, preferencesService, taskService); assertThat(Arrays.asList(Objects.requireNonNull(customMapsDirectory.getRoot().list())), not(contains(testMapNameGenerator))); when(downloadMapGeneratorTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); when(generateMapTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); doAnswer(invocation -> { @SuppressWarnings("unchecked") CompletableTask<Void> task = invocation.getArgument(0); WaitForAsyncUtils.asyncFx(task); task.getFuture().get(); return task; }).when(taskService).submitTask(any()); }</code><technical_language>catch this throw</technical_language>

Target:
public void setUp() throws IOException { customMapsDirectory.newFolder(testMapNameGenerator); fafDataDirectory.newFolder(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY); String generatorExecutableName = String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), versionGeneratorPresent); Files.createFile(fafDataDirectory.getRoot().toPath().resolve(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY).resolve(generatorExecutableName)); when(preferencesService.getFafDataDirectory()).thenReturn(fafDataDirectory.getRoot().toPath()); Preferences preferences = new Preferences(); preferences.getForgedAlliance().setCustomMapsDirectory(customMapsDirectory.getRoot().toPath()); when(preferencesService.getPreferences()).thenReturn(preferences); instance = new MapGeneratorService(applicationContext, preferencesService, taskService); instance.postConstruct(); assertThat(Arrays.asList(Objects.requireNonNull(customMapsDirectory.getRoot().list())), not(contains(testMapNameGenerator))); when(downloadMapGeneratorTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); when(generateMapTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); doAnswer(invocation -> { @SuppressWarnings("unchecked") CompletableTask<Void> task = invocation.getArgument(0); task.getFuture().get(); return task; }).when(taskService).submitTask(any()); }
Source:
<code>public static ReadBuffer wrapUnsafe(ByteBuffer buffer) { if (buffer.hasArray()) { int pos = buffer.position(); <START> return wrap(buffer.array(), buffer.arrayOffset() + pos); <END> } return new ReadBuffer.Buff(buffer); }</code><technical_language>remaining() - efficient slice, in case buffer end of array</technical_language>

Target:
public static ReadBuffer wrapUnsafe(ByteBuffer buffer) { if (buffer.hasArray()) { int offset = buffer.arrayOffset() + buffer.position(); int limit = offset + buffer.remaining(); return wrap(buffer.array(), offset, limit); } return buffer.order() == ByteOrder.BIG_ENDIAN ? new BigEndianByteBuffer(buffer) : new LittleEndianByteBuffer(buffer); }
Source:
<code><START> public java.util.Calendar getLastModifiedAsCalendar() { <END> final java.util.Calendar cal = new java.util.GregorianCalendar(); cal.setTimeInMillis(lastModified); return cal; }</code><technical_language>@Restricted reason this exists is Jelly view</technical_language>

Target:
public Calendar getLastModifiedAsCalendar() { final Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(lastModified); return cal; }
Source:
<code>public void testClientOpenThrowsTransportExceptionIfNatsNotConnected() throws Exception { when(mockConn.getState()).thenReturn(Constants.ConnState.DISCONNECTED); try { <START> client.open(); <END> } catch(TTransportException ex) { assertEquals(TTransportException.NOT_OPEN, ex.getType()); assertEquals("NATS not connected, has status DISCONNECTED", ex.getMessage()); } }</code><technical_language>Do need a fail() here</technical_language>

Target:
public void testClientOpenThrowsTransportExceptionIfNatsNotConnected() throws Exception { when(mockConn.getState()).thenReturn(Constants.ConnState.DISCONNECTED); try { client.open(); fail(); } catch(TTransportException ex) { assertEquals(TTransportException.NOT_OPEN, ex.getType()); assertEquals("NATS not connected, has status DISCONNECTED", ex.getMessage()); } }
Source:
<code>public String getType() { <START> return null; <END> }</code><technical_language>return Polygon MultiPolygon create implementations</technical_language>

Target:
public String getType() { return "Polygon"; }
Source:
<code>public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block) { AbstractMapBlock mapBlock = (AbstractMapBlock) block; int positionCount = mapBlock.getPositionCount(); int offsetBase = mapBlock.getOffsetBase(); int[] offsets = mapBlock.getOffsets(); int[] hashTable = mapBlock.getHashTables(); int entriesStartOffset = offsets[offsetBase]; int entriesEndOffset = offsets[offsetBase + positionCount]; TypeSerde.writeType(sliceOutput, mapBlock.keyType); <START> blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getKeys().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); <END> blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getValues().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); sliceOutput.appendInt((entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER); sliceOutput.writeBytes(wrappedIntArray(hashTable, entriesStartOffset * HASH_MULTIPLIER, (entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER)); sliceOutput.appendInt(positionCount); for (int position = 0; position < positionCount + 1; position++) { sliceOutput.writeInt(offsets[offsetBase + position] - entriesStartOffset); } EncoderUtil.encodeNullsAsBits(sliceOutput, block); }</code><technical_language>add a helper mapBlock get key block... actually, rename getKeys getRawKeysBlock, this default behavior</technical_language>

Target:
public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block) { AbstractMapBlock mapBlock = (AbstractMapBlock) block; int positionCount = mapBlock.getPositionCount(); int offsetBase = mapBlock.getOffsetBase(); int[] offsets = mapBlock.getOffsets(); int[] hashTable = mapBlock.getHashTables(); int entriesStartOffset = offsets[offsetBase]; int entriesEndOffset = offsets[offsetBase + positionCount]; TypeSerde.writeType(sliceOutput, mapBlock.keyType); blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getRawKeyBlock().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getRawValueBlock().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); sliceOutput.appendInt((entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER); sliceOutput.writeBytes(wrappedIntArray(hashTable, entriesStartOffset * HASH_MULTIPLIER, (entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER)); sliceOutput.appendInt(positionCount); for (int position = 0; position < positionCount + 1; position++) { sliceOutput.writeInt(offsets[offsetBase + position] - entriesStartOffset); } EncoderUtil.encodeNullsAsBits(sliceOutput, block); }
Source:
<code>public Response manifestDetails(@Context HttpServletRequest request) { ServletContext context = request.getSession().getServletContext(); try { InputStream manifestStream = context.getResourceAsStream("/META-INF/MANIFEST.MF"); return Response.ok(new Manifest(manifestStream).getMainAttributes()).build(); } catch (Exception e) { <START> return Response.serverError().build(); <END> } }</code><technical_language>bubble - return 404</technical_language>

Target:
public Response manifestDetails(@Context HttpServletRequest request) { final ServletContext context = request.getSession().getServletContext(); try { final InputStream manifestStream = context.getResourceAsStream("/META-INF/MANIFEST.MF"); return Response.ok(new Manifest(manifestStream).getMainAttributes()).build(); } catch (Exception e) { return Response.status(Response.Status.NOT_FOUND).entity("Could not find version information").build(); } }
Source:
<code>public void visitBinaryExpression(BinaryExpressionTree tree) { Tree.Kind peek = stack.peek(); Tree.Kind kind = getKind(tree); <START> if (TABLE.get(peek, kind) == Boolean.TRUE) { <END> raiseIssue(tree); } stack.push(kind); super.visitBinaryExpression(tree); stack.pop(); }</code><technical_language>This BooleanUtils.isTrue</technical_language>

Target:
public void visitBinaryExpression(BinaryExpressionTree tree) { Tree.Kind peek = stack.peek(); Tree.Kind kind = getKind(tree); if (requiresParenthesis(peek, kind)) { raiseIssue(tree); } stack.push(kind); super.visitBinaryExpression(tree); stack.pop(); }
Source:
<code>public void beforeTest() { SWTBotUtils.createProject(PROJECT_NAME); SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); assertNotNull(treeItem); final CtfTmfTestTrace <START> cygProfile = <END> CtfTmfTestTrace.CYG_PROFILE; final File file = new File(cygProfile.getTrace().getPath()); SWTBotUtils.openTrace(PROJECT_NAME, file.getAbsolutePath(), UST_ID); SWTBotUtils.openView(CallStackView.ID); SWTBotUtils.waitForJobs(); fExpected = ImmutableList.of("40472b", "4045c8", "404412", "", ""); }</code><technical_language>need assumeTrue(cygProfile.exists()); trace is present</technical_language>

Target:
public void beforeTest() { SWTBotUtils.createProject(PROJECT_NAME); SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); assertNotNull(treeItem); final CtfTmfTestTrace cygProfile = CtfTmfTestTrace.CYG_PROFILE; assumeTrue(cygProfile.exists()); final File file = new File(cygProfile.getTrace().getPath()); SWTBotUtils.openTrace(PROJECT_NAME, file.getAbsolutePath(), UST_ID); SWTBotUtils.openView(CallStackView.ID); SWTBotUtils.waitForJobs(); fExpected = ImmutableList.of("40472b", "4045c8", "404412", "", ""); }
Source:
<code>public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, ctx -> { CallExpression callExpression = (CallExpression) ctx.syntaxNode(); Expression callee = callExpression.callee(); if (!callee.type().canHaveMember("__call__")) { <START> Optional<String> nameOptional = nameFromExpression(callee); <END> if (nameOptional.isPresent()) { ctx.addIssue(callee, String.format("Fix this call; \"%s\" is not callable.", nameOptional.get())); } else { ctx.addIssue(callee, "Fix this call; this expression is not callable."); } } }); }</code><technical_language>minor: I I prefer nameFromExpression return null in this case</technical_language>

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, ctx -> { CallExpression callExpression = (CallExpression) ctx.syntaxNode(); Expression callee = callExpression.callee(); InferredType calleeType = callee.type(); if (!calleeType.canHaveMember("__call__") || NON_CALLABLE_TYPES.stream().anyMatch(calleeType::canOnlyBe)) { String name = nameFromExpression(callee); if (name != null) { ctx.addIssue(callee, String.format("Fix this call; \"%s\" is not callable.", name)); } else { ctx.addIssue(callee, "Fix this call; this expression is not callable."); } } }); }
Source:
<code>public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { PolygonSymbolizer symbolizer; MBStyleTransformer transformer = new MBStyleTransformer(parse); Fill fill; DisplacementImpl displacement = new DisplacementImpl(); displacement.setDisplacementX(getFillExtrusionBase().doubleValue()); displacement.setDisplacementY(getFillExtrusionHeight().doubleValue()); if (getFillExtrusionPattern() != null) { ExternalGraphic eg = transformer.createExternalGraphicForSprite(getFillExtrusionPattern(), styleContext); GraphicFill gf = sf.graphicFill(Arrays.asList(eg), fillExtrusionOpacity(), null, null, null, displacement); fill = sf.fill(gf, null, null); } else { fill = sf.fill(null, fillExtrusionColor(), fillExtrusionOpacity()); } symbolizer = sf.polygonSymbolizer( getId(), ff.property((String)null), sf.description(Text.text("fill"),null), NonSI.PIXEL, null, fill, displacement, ff.literal(0)); MBFilter filter = getFilter(); Rule rule = sf.rule( getId(), null, null, 0.0, Double.POSITIVE_INFINITY, Arrays.asList(symbolizer), filter.filter()); rule.setLegendGraphic(new Graphic[0]); <START> return null; <END> }</code><technical_language>If returning here, remove method return statement. fine returning a fill for now</technical_language>

Target:
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { PolygonSymbolizer symbolizer; MBStyleTransformer transformer = new MBStyleTransformer(parse); Fill fill; DisplacementImpl displacement = new DisplacementImpl(); displacement.setDisplacementX(getFillExtrusionBase().doubleValue()); displacement.setDisplacementY(getFillExtrusionHeight().doubleValue()); if (getFillExtrusionPattern() != null) { ExternalGraphic eg = transformer.createExternalGraphicForSprite(getFillExtrusionPattern(), styleContext); GraphicFill gf = sf.graphicFill(Arrays.asList(eg), fillExtrusionOpacity(), null, null, null, displacement); fill = sf.fill(gf, null, null); } else { fill = sf.fill(null, fillExtrusionColor(), fillExtrusionOpacity()); } symbolizer = sf.polygonSymbolizer( getId(), ff.property((String)null), sf.description(Text.text("fill"),null), NonSI.PIXEL, null, fill, displacement, ff.literal(0)); MBFilter filter = getFilter(); Rule rule = sf.rule( getId(), null, null, 0.0, Double.POSITIVE_INFINITY, Arrays.asList(symbolizer), filter.filter()); rule.setLegendGraphic(new Graphic[0]); return Collections.singletonList(sf.featureTypeStyle( getId(), sf.description( Text.text("MBStyle "+getId()), Text.text("Generated for "+getSourceLayer())), null, Collections.emptySet(), filter.semanticTypeIdentifiers(), Arrays.asList(rule) )); }
Source:
<code>protected boolean canDoAction() { updateVmDisksFromDb(); Snapshot snapshot = getSnapshotDao().get(getParameters().getDstSnapshotId()); SnapshotsValidator snapshotsValidator = new SnapshotsValidator(); VmValidator vmValidator = new VmValidator(getVm()); boolean result = validate(vmValidator.vmDown()) && validate(snapshotsValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotsValidator.vmNotInPreview(getVmId())) && validate(snapshotsValidator.snapshotExists(snapshot)) && validate(snapshotsValidator.snapshotNotBroken(snapshot)); Collection<DiskImage> diskImages = <START> ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, true); <END> if (!diskImages.isEmpty()) { result = result && validate(new StoragePoolValidator(getStoragePool()).isUp()) && ImagesHandler.PerformImagesChecks( getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, true, true, false, false, true, true, diskImages); } if (result && LinqUtils.foreach(diskImages, new Function<DiskImage, Guid>() { @Override public Guid eval(DiskImage disk) { return disk.getvm_snapshot_id().getValue(); } }).contains(getParameters().getDstSnapshotId())) { result = false; addCanDoActionMessage(VdcBllMessages.CANNOT_PREIEW_CURRENT_IMAGE); } if (!result) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__PREVIEW); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__SNAPSHOT); } return result; }</code><technical_language>1. note - filtering in perform images check is done true, false..while false, true parameters. problem that? 2. i guess disk load line 203 moved well</technical_language>

Target:
protected boolean canDoAction() { Snapshot snapshot = getSnapshotDao().get(getParameters().getDstSnapshotId()); SnapshotsValidator snapshotsValidator = new SnapshotsValidator(); VmValidator vmValidator = new VmValidator(getVm()); boolean result = validate(vmValidator.vmDown()) && validate(snapshotsValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotsValidator.vmNotInPreview(getVmId())) && validate(snapshotsValidator.snapshotExists(snapshot)) && validate(snapshotsValidator.snapshotNotBroken(snapshot)); updateVmDisksFromDb(); Collection<DiskImage> diskImages = ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, true); if (!diskImages.isEmpty()) { result = result && validate(new StoragePoolValidator(getStoragePool()).isUp()) && ImagesHandler.PerformImagesChecks( getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, true, true, false, false, true, true, diskImages); } if (result && LinqUtils.foreach(diskImages, new Function<DiskImage, Guid>() { @Override public Guid eval(DiskImage disk) { return disk.getvm_snapshot_id().getValue(); } }).contains(getParameters().getDstSnapshotId())) { result = false; addCanDoActionMessage(VdcBllMessages.CANNOT_PREIEW_CURRENT_IMAGE); } if (!result) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__PREVIEW); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__SNAPSHOT); } return result; }
Source:
<code>public void open(Configuration parameters) throws Exception { Preconditions.checkState( getRuntimeContext().getNumberOfParallelSubtasks() == 1, <START> "The parallelism of SocketServerSink must be 1"); <END> initBuffer(); version = UUID.randomUUID().toString(); lastCheckpointId = Long.MIN_VALUE; serverThread = new ServerThread(); serverThread.start(); Preconditions.checkNotNull(eventGateway, "Operator event gateway hasn't been set"); InetSocketAddress address = serverThread.getServerSocketAddress(); LOG.info("Collect sink server established, address = " + address); CollectSinkAddressEvent addressEvent = new CollectSinkAddressEvent(address); eventGateway.sendEventToCoordinator(addressEvent); }</code><technical_language>SocketServerSink => CollectSinkOperator</technical_language>

Target:
public void open(Configuration parameters) throws Exception { Preconditions.checkState( getRuntimeContext().getNumberOfParallelSubtasks() == 1, "The parallelism of CollectSinkFunction must be 1"); initBuffer(); version = UUID.randomUUID().toString(); serverThread = new ServerThread(); serverThread.start(); Preconditions.checkNotNull(eventGateway, "Operator event gateway hasn't been set"); InetSocketAddress address = serverThread.getServerSocketAddress(); LOG.info("Collect sink server established, address = " + address); CollectSinkAddressEvent addressEvent = new CollectSinkAddressEvent(address); eventGateway.sendEventToCoordinator(addressEvent); }
Source:
<code>public void dispose () { if (screen != null) screen.hide(); if (nextScreen != null) nextScreen.hide(); <START> <END> }</code><technical_language>FBOs disposed well, created here</technical_language>

Target:
public void dispose () { if (screen != null) screen.hide(); if (nextScreen != null) nextScreen.hide(); this.currentScreenFBO.dispose(); this.nextScreenFBO.dispose(); }
Source:
<code>private static void validateValue(Object value) { Class<?> clazz = value.getClass(); if (simples.contains(clazz)) return; if (simpleArrays.contains(clazz) || primitiveArrays.contains(clazz)) return; if (value instanceof Collection) { for (Object <START> name : <END> (Collection<?>) value) { Class<?> containedClazz = name.getClass(); if (!simples.contains(containedClazz)) { throw new IllegalArgumentException(containedClazz.getName() + " in " + clazz.getName()); } } return; } throw new IllegalArgumentException(clazz.getName()); }</code><technical_language>rename simple</technical_language>

Target:
private static void validateValue(Object value) { Class<?> clazz = value.getClass(); if (simples.contains(clazz)) return; if (simpleArrays.contains(clazz) || primitiveArrays.contains(clazz)) return; if (value instanceof Collection) { for (Object simple : (Collection<?>) value) { Class<?> containedClazz = simple.getClass(); if (!simples.contains(containedClazz)) { throw new IllegalArgumentException(containedClazz.getName() + " in " + clazz.getName()); } } return; } throw new IllegalArgumentException(clazz.getName()); }
Source:
<code>private void scanFile(SensorContext sensorContext, InputFile inputFile) throws IOException { final HtlScanner scanner = setupScanner(); HtmlSourceCode sourceCode = new HtmlSourceCode(inputFile); <START> Reader reader = new StringReader(inputFile.contents()); <END> scanner.scan(lexer.parse(reader), sourceCode); saveMetrics(sensorContext, sourceCode); saveLineLevelMeasures(inputFile, sourceCode); }</code><technical_language>Reader closed usage</technical_language>

Target:
void scanFile(SensorContext sensorContext, InputFile inputFile) throws IOException { final HtlScanner scanner = setupScanner(); HtmlSourceCode sourceCode = new HtmlSourceCode(inputFile); try (Reader reader = new StringReader(inputFile.contents())) { List<Node> nodeList = lexer.parse(reader); scanner.scan(nodeList, sourceCode); MetricsSaver.saveIssues(sensorContext, sourceCode); MetricsSaver.saveMeasures(sensorContext, sourceCode); MetricsSaver.saveLineLevelMeasures(inputFile, sourceCode, fileLinesContextFactory); } }
Source:
<code>public double calculateGenotypeConcordance(final GenotypeConcordanceScheme scheme, final boolean missingSitesFlag) { double numerator = 0.0; double denominator = 0.0; scheme.validateScheme(); final TruthState[] allTruthStates = TruthState.values(); final CallState[] allCallStates = CallState.values(); for (final TruthState truthState : allTruthStates) { for (final CallState callState : allCallStates) { if(!missingSitesFlag && isMissing(truthState, callState)) { continue; } else { final TruthAndCallStates truthAndCallStates = new TruthAndCallStates(truthState, callState); final int count = getCount(truthAndCallStates); <START> if (truthState.toString().equals(callState.toString())) { END> numerator += count; denominator += count; } else { denominator += count; } } } } return (numerator / denominator); }</code><technical_language>space //</technical_language>

Target:
public double calculateGenotypeConcordance(final GenotypeConcordanceScheme scheme, final boolean missingSitesFlag) { return calculateGenotypeConcordanceUtil(scheme, missingSitesFlag, true); }
Source:
<code>static Collection<org.spongepowered.api.profile.GameProfile> getAllProfiles() { Set<org.spongepowered.api.profile.GameProfile> profiles = Sets.newHashSet(); for (User user : userCache.asMap().values()) { profiles.add(user.getProfile()); } SaveHandler saveHandler = (SaveHandler) DimensionManager.getWorldFromDimId(0).getSaveHandler(); String[] uuids = saveHandler.getAvailablePlayerDat(); for (String playerUuid : uuids) { <START> if (!UUID_PATTERN.reset(playerUuid).matches()) { <END> continue; } GameProfile profile = MinecraftServer.getServer().getPlayerProfileCache().getProfileByUUID(UUID.fromString(playerUuid)); if (profile != null) { profiles.add((org.spongepowered.api.profile.GameProfile) profile); } } UserListWhitelist whiteList = MinecraftServer.getServer().getConfigurationManager().getWhitelistedPlayers(); for (UserListWhitelistEntry entry : whiteList.getValues().values()) { profiles.add((org.spongepowered.api.profile.GameProfile) entry.value); } UserListBans banList = MinecraftServer.getServer().getConfigurationManager().getBannedPlayers(); for (UserListBansEntry entry : banList.getValues().values()) { profiles.add((org.spongepowered.api.profile.GameProfile) entry.value); } return profiles; }</code><technical_language>storing a matcher Pattern? usage of reset issues in multithreaded environments</technical_language>

Target:
static Collection<org.spongepowered.api.profile.GameProfile> getAllProfiles() { Set<org.spongepowered.api.profile.GameProfile> profiles = Sets.newHashSet(); for (User user : userCache.asMap().values()) { profiles.add(user.getProfile()); } SaveHandler saveHandler = (SaveHandler) DimensionManager.getWorldFromDimId(0).getSaveHandler(); String[] uuids = saveHandler.getAvailablePlayerDat(); Matcher uuidMatcher = UUID_PATTERN.matcher(""); for (String playerUuid : uuids) { if (!uuidMatcher.reset(playerUuid).matches()) { continue; } GameProfile profile = MinecraftServer.getServer().getPlayerProfileCache().getProfileByUUID(UUID.fromString(playerUuid)); if (profile != null) { profiles.add((org.spongepowered.api.profile.GameProfile) profile); } } UserListWhitelist whiteList = MinecraftServer.getServer().getConfigurationManager().getWhitelistedPlayers(); for (UserListWhitelistEntry entry : whiteList.getValues().values()) { profiles.add((org.spongepowered.api.profile.GameProfile) entry.value); } UserListBans banList = MinecraftServer.getServer().getConfigurationManager().getBannedPlayers(); for (UserListBansEntry entry : banList.getValues().values()) { profiles.add((org.spongepowered.api.profile.GameProfile) entry.value); } return profiles; }
Source:
<code><START> public void zoom(double delta, Point2D center) { <END> Point2D world; double zoom = 1 + delta * ZOOM_FACTOR; try { world = scale.inverseTransform(center.getX() - toCenter.getX() - translate.getX(), center.getY() - toCenter.getY() - translate.getY()); Transform newScale = scale.createConcatenation(new Scale(zoom, zoom, world.getX(), world.getY())); if (newScale.getMyy() > ZOOM_OUT_BOUND && newScale.getMxx() < ZOOM_IN_BOUND) { scale.setToTransform(newScale); } } catch (NonInvertibleTransformException e) { e.printStackTrace(); } }</code><technical_language>this private now</technical_language>

Target:
protected void zoom(double delta, Point2D center) { Point2D world; double zoom = 1 + delta * ZOOM_FACTOR; try { world = scale.inverseTransform(center.getX() - toCenter.getX() - translate.getX(), center.getY() - toCenter.getY() - translate.getY()); Transform newScale = scale.createConcatenation(new Scale(zoom, zoom, world.getX(), world.getY())); if (newScale.getMyy() > ZOOM_OUT_BOUND && newScale.getMxx() < ZOOM_IN_BOUND) { scale.setToTransform(newScale); } } catch (NonInvertibleTransformException e) { e.printStackTrace(); } }
Source:
<code>public void updateStockPrice(String symbol, double newPrice) throws StockMarketException { if (getStockForSymbol(symbol) == null) { throw new StockMarketException("Stock not present (" + symbol + ")"); } if (newPrice < 0.0) { throw new StockMarketException( "Stock price cannot be set to a negative value (" + symbol + ", " + getStockForSymbol(symbol).getPrice() + ") -> " + newPrice + " X Not Allowed "); } <START> Stock s = removeStockFromStockList(symbol); <END> s.setPrice(newPrice); addStock(s); }</code><technical_language>name more descriptive</technical_language>

Target:
public void updateStockPrice(String symbol, double newPrice) throws StockMarketException { if (getStockForSymbol(symbol) == null) { throw new StockMarketException("Stock not present (" + symbol + ")"); } if (newPrice < 0.0) { throw new StockMarketException( "Stock price cannot be set to a negative value (" + symbol + ", " + getStockForSymbol(symbol).getPrice() + ") -> " + newPrice + " X Not Allowed "); } Stock stock = removeStockFromStockList(symbol); stock.setPrice(newPrice); addStock(stock); }
Source:
<code>private List<GlusterVolumeEntity> getAllGlusterVolumesWithMasterCompatibleVersion(Guid masterVolumeId) { GlusterVolumeEntity masterVolume = getGlusterVolumeDao().getById(masterVolumeId); VDSGroup masterCluster = getVdsGroupDao().get(masterVolume.getClusterId()); List<VDSGroup> clusters = getVdsGroupDao().getClustersByServiceAndCompatibilityVersion(true, false, masterCluster.getcompatibility_version().getValue()); <START> List<GlusterVolumeEntity> volumes = new ArrayList<GlusterVolumeEntity>(); <END> if(clusters != null) { for(VDSGroup currentCluster : clusters) { if(!currentCluster.getId().equals(masterCluster.getId())) { volumes.addAll(getGlusterVolumeDao().getByClusterId(currentCluster.getId())); } } } return volumes; }</code><technical_language>diamond operator? i.e new ArrayList<></technical_language>

Target:
private List<GlusterVolumeEntity> getAllGlusterVolumesWithMasterCompatibleVersion(Guid masterVolumeId) { GlusterVolumeEntity masterVolume = getGlusterVolumeDao().getById(masterVolumeId); VDSGroup masterCluster = getVdsGroupDao().get(masterVolume.getClusterId()); List<VDSGroup> clusters = getVdsGroupDao().getClustersByServiceAndCompatibilityVersion(true, false, masterCluster.getcompatibility_version().getValue()); List<GlusterVolumeEntity> volumes = new ArrayList<>(); if(clusters != null) { for(VDSGroup currentCluster : clusters) { if(!currentCluster.getId().equals(masterCluster.getId())) { volumes.addAll(getGlusterVolumeDao().getByClusterId(currentCluster.getId())); } } } return volumes; }
Source:
<code>public void onEventMainThread(final NotificationEvents.NoteModerationStatusChanged event) { if (event.mIsModerating) { <START> setNoteIsModerating(event.mNoteId, event.mIsModerating); <END> EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteModerationStatusChanged.class); } else { NotificationsActions.downloadNoteAndUpdateDB(event.mNoteId, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { setNoteIsModerating(event.mNoteId, event.mIsModerating); EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteModerationStatusChanged.class); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { setNoteIsModerating(event.mNoteId, event.mIsModerating); EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteModerationStatusChanged.class); } } ); } }</code><technical_language>Is normal a m named member in this way? I considered private, event.noteId here</technical_language>

Target:
public void onEventMainThread(final NotificationEvents.NoteModerationStatusChanged event) { if (event.isModerating) { setNoteIsModerating(event.noteId, event.isModerating); EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteModerationStatusChanged.class); } else { NotificationsActions.downloadNoteAndUpdateDB(event.noteId, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { setNoteIsModerating(event.noteId, event.isModerating); EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteModerationStatusChanged.class); } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { setNoteIsModerating(event.noteId, event.isModerating); EventBus.getDefault().removeStickyEvent(NotificationEvents.NoteModerationStatusChanged.class); } } ); } }
Source:
<code>public T next() { <START> final T next = this.nextValue; <END> this.nextValue = advance(); return next; }</code><technical_language>need this. constructor</technical_language>

Target:
public T next() { final T next = nextValue; nextValue = advance(); return next; }
Source:
<code>protected PivotTableModule() { <START> super(NAME, 1, OWidgetsModule.NAME); <END> }</code><technical_language>modifing datamodel: version increased allow merge changes existing databases</technical_language>

Target:
protected PivotTableModule() { super(NAME, 2, OWidgetsModule.NAME); }
Source:
<code>public boolean evaluate( String referer ) { <START> ExternalSearch es_inst = ExternalSearch.getInstance(); <END> return es_inst.isExternalSearch( referer ); }</code><technical_language>Please change externalSearch =</technical_language>

Target:
public boolean evaluate( String referer ) { ExternalSearch externalSearch = ExternalSearch.getInstance(); return externalSearch.isExternalSearch( referer ); }
Source:
<code>public void shouldEditAnAutoGenerationOption() throws Exception { final String newLocation = "9356400c-a5a2-4532-8f2b-2361b3446eb8"; final String newSource = "0d47284f-9e9b-4a81-a88b-8bb42bc0a902"; boolean automaticGenerationEnabled = false; boolean manualEntryEnabled = false; SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("location", newLocation); autoGenerationOption.add("source", newSource); autoGenerationOption.add("manualEntryEnabled", manualEntryEnabled); autoGenerationOption.add("automaticGenerationEnabled", automaticGenerationEnabled); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); assertEquals(newLocation, identifierSourceService <START> .getAutoGenerationOption(Context.getPatientService().getPatientIdentifierTypeByUuid(getUuid())) <END> .getLocation().getUuid()); assertEquals(newSource, identifierSourceService .getAutoGenerationOption(Context.getPatientService().getPatientIdentifierTypeByUuid(getUuid())) .getSource().getUuid()); assertFalse(identifierSourceService .getAutoGenerationOption(Context.getPatientService().getPatientIdentifierTypeByUuid(getUuid())) .isAutomaticGenerationEnabled()); assertFalse(identifierSourceService .getAutoGenerationOption(Context.getPatientService().getPatientIdentifierTypeByUuid(getUuid())) .isManualEntryEnabled()); }</code><technical_language>Declare Context.getPatientService().getPatientIdentifierTypeByUuid(getUuid()) top</technical_language>

Target:
public void shouldEditAnAutoGenerationOption() throws Exception { assertEquals(LOCATION, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getLocation().getUuid()); assertEquals(SOURCE, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getSource().getUuid()); assertTrue( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertTrue(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("location", NEW_LOCATION); autoGenerationOption.add("source", NEW_SOURCE); autoGenerationOption.add("manualEntryEnabled", false); autoGenerationOption.add("automaticGenerationEnabled", false); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI() + "/" + getUuid()); req.setContent(json.getBytes()); handle(req); assertEquals(NEW_LOCATION, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getLocation().getUuid()); assertEquals(NEW_SOURCE, identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).getSource().getUuid()); assertFalse( identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isAutomaticGenerationEnabled()); assertFalse(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid())).isManualEntryEnabled()); }
Source:
<code><START> public OutgoingChatMessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { <END> final LayoutInflater inflater = LayoutInflater.from(parent.getContext()); final View res; if (viewType == 0) { res = inflater.inflate(R.layout.view_chatmessage, parent, false); } else { res = inflater.inflate(R.layout.view_outgoing_chatmessage, parent, false); } return new OutgoingChatMessageViewHolder(res); }</code><technical_language>@ligi abusing this Viewholder update content for ReceivedChatMessage OutgoingChatMessage? If I suggest renaming ChatMessageViewHolder avoid confusion. And, I personally put ViewHolder in a separate file for readability reasons</technical_language>

Target:
public ChatMessageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { final LayoutInflater inflater = LayoutInflater.from(parent.getContext()); final View res; if (viewType == 0) { res = inflater.inflate(R.layout.view_chatmessage, parent, false); } else { res = inflater.inflate(R.layout.view_outgoing_chatmessage, parent, false); } return new ChatMessageViewHolder(res); }
Source:
<code>public Flux<Checkpoint> listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) { String prefix = getBlobPrefix(fullyQualifiedNamespace, eventHubName, consumerGroup, CHECKPOINT_PATH); <START> BlobListDetails details = new BlobListDetails().setRetrieveMetadata(true); <END> ListBlobsOptions options = new ListBlobsOptions().setPrefix(prefix).setDetails(details); return blobContainerAsyncClient.listBlobs(options) .filter(blobItem -> blobItem.getName().split(BLOB_PATH_SEPARATOR).length == 5) .map(this::convertToCheckpoint); }</code><technical_language>this duplicated code (it similar set of lines in 84) put in a function? way, if decide update path splits, updated in place</technical_language>

Target:
public Flux<Checkpoint> listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) { String prefix = getBlobPrefix(fullyQualifiedNamespace, eventHubName, consumerGroup, CHECKPOINT_PATH); return listBlobs(prefix, this::convertToCheckpoint); }
Source:
<code>public CuratorFramework curatorFramework(RetryPolicy retryPolicy, ZookeeperProperties properties, ObjectProvider<CuratorFrameworkCustomizer> optionalCuratorFrameworkCustomizerProvider, ObjectProvider<EnsembleProvider> optionalEnsembleProvider, ObjectProvider<TracerDriver> optionalTracerDriverProvider) throws Exception { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); EnsembleProvider ensembleProvider = optionalEnsembleProvider.getIfAvailable(); if (ensembleProvider != null) { builder.ensembleProvider(ensembleProvider); } else { builder.connectString(properties.getConnectString()); } builder.sessionTimeoutMs((int) properties.getSessionTimeout().toMillis()) .connectionTimeoutMs((int) properties.getConnectionTimeout().toMillis()) .retryPolicy(retryPolicy); optionalCuratorFrameworkCustomizerProvider <START> .ifAvailable(customizer -> customizer.customize(builder)); <END> CuratorFramework curator = builder.build(); TracerDriver tracerDriver = optionalTracerDriverProvider.getIfAvailable(); if (curator.getZookeeperClient() != null && tracerDriver != null) { curator.getZookeeperClient().setTracerDriver(tracerDriver); } curator.start(); log.trace("blocking until connected to zookeeper for " + properties.getBlockUntilConnectedWait() + properties.getBlockUntilConnectedUnit()); curator.blockUntilConnected(properties.getBlockUntilConnectedWait(), properties.getBlockUntilConnectedUnit()); log.trace("connected to zookeeper"); return curator; }</code><technical_language>this work a list. I optionalCuratorFrameworkCustomizerProvider.orderdStream().forEach()..</technical_language>

Target:
public CuratorFramework curatorFramework(RetryPolicy retryPolicy, ZookeeperProperties properties, ObjectProvider<CuratorFrameworkCustomizer> optionalCuratorFrameworkCustomizerProvider, ObjectProvider<EnsembleProvider> optionalEnsembleProvider, ObjectProvider<TracerDriver> optionalTracerDriverProvider) throws Exception { CuratorFrameworkFactory.Builder builder = CuratorFrameworkFactory.builder(); EnsembleProvider ensembleProvider = optionalEnsembleProvider.getIfAvailable(); if (ensembleProvider != null) { builder.ensembleProvider(ensembleProvider); } else { builder.connectString(properties.getConnectString()); } builder.sessionTimeoutMs((int) properties.getSessionTimeout().toMillis()) .connectionTimeoutMs((int) properties.getConnectionTimeout().toMillis()) .retryPolicy(retryPolicy); optionalCuratorFrameworkCustomizerProvider.orderedStream() .forEach(curatorFrameworkCustomizer -> curatorFrameworkCustomizer .customize(builder)); CuratorFramework curator = builder.build(); TracerDriver tracerDriver = optionalTracerDriverProvider.getIfAvailable(); if (curator.getZookeeperClient() != null && tracerDriver != null) { curator.getZookeeperClient().setTracerDriver(tracerDriver); } curator.start(); log.trace("blocking until connected to zookeeper for " + properties.getBlockUntilConnectedWait() + properties.getBlockUntilConnectedUnit()); curator.blockUntilConnected(properties.getBlockUntilConnectedWait(), properties.getBlockUntilConnectedUnit()); log.trace("connected to zookeeper"); return curator; }
Source:
<code>public void handleRequest(HttpServerExchange exchange) throws Exception { AttachmentContent attachment = exchange.getAttachment(AttachmentContent.KEY); try { next.handleRequest(exchange); } finally { byte[] previewBytes = converter.convert(attachment.getMessage()); <START> messagePreviewLog.add(attachment.getTopic().getName(), previewBytes); <END> } }</code><technical_language>this code runs for message</technical_language>

Target:
public void handleRequest(HttpServerExchange exchange) throws Exception { AttachmentContent attachment = exchange.getAttachment(AttachmentContent.KEY); try { next.handleRequest(exchange); } finally { messagePreviewLog.add(attachment.getTopic().getName(), attachment.getMessage()); } }
Source:
<code>LocalGradleDistribution(File location) { <START> this.location = Preconditions.checkNotNull(location).getAbsoluteFile(); <END> Optional<String> error = validate(location); Preconditions.checkArgument(!error.isPresent(), error.or("")); }</code><technical_language>Calling getAbsoluteFile does't sense this deep in code. If deal relative files, assert absolute. I deal relative files fine do surprising here</technical_language>

Target:
LocalGradleDistribution(File location) { this.location = Preconditions.checkNotNull(location); }
Source:
<code>public void <START> testHandleSchemesForMultipleSchemes() <END> { RegistrationWindows registrationWindows = new RegistrationWindows(registryWriter); SchemeInformation schemeToTestInformation = new SchemeInformation("schemeToTest", "SchemsToTest is for testing", System.getProperty("eclipse.launcher")); SchemeInformation adtSchemeInformation = new SchemeInformation("adtScheme", "AdtScheme is for testing", System.getProperty("eclipse.launcher")); SchemeInformation otherSchemeInformation = new SchemeInformation("otherScheme", "OtherScheme is for testing", System.getProperty("eclipse.launcher")); registrationWindows.handleSchemes( Arrays.asList(schemeToTestInformation, adtSchemeInformation, otherSchemeInformation), Arrays.asList(adtSchemeInformation, schemeToTestInformation, otherSchemeInformation)); assertEquals(null, registryWriter.getRegisteredHandlerPath("schemeToTest")); }</code><technical_language>remove add scheme. this intention</technical_language>

Target:
public void testHandleSchemesForMultipleSchemes() { SchemeInformation schemeToTestInformation = new SchemeInformation("schemeToTest", "SchemsToTest is for testing", System.getProperty("eclipse.launcher")); SchemeInformation adtSchemeInformation = new SchemeInformation("adtScheme", "AdtScheme is for testing", System.getProperty("eclipse.launcher")); SchemeInformation otherSchemeInformation = new SchemeInformation("otherScheme", "OtherScheme is for testing", System.getProperty("eclipse.launcher")); registrationWindows.handleSchemes( Arrays.asList(schemeToTestInformation, adtSchemeInformation, otherSchemeInformation), Arrays.asList(adtSchemeInformation, schemeToTestInformation, otherSchemeInformation)); assertEquals(null, registryWriter.getRegisteredHandlerPath("schemeToTest")); }
Source:
<code>private DtoVtepBinding addAndVerifyBinding(DtoVtep vtep, UUID bridgeId, String portName, int vlan, boolean firstBinding) { DtoBridge oldBridge = getBridge(bridgeId); DtoVtepBinding binding = postBinding(vtep, makeBinding(vtep.getId(), portName, vlan, bridgeId)); assertEquals(bridgeId, binding.getNetworkId()); assertEquals(portName, binding.getPortName()); assertEquals(vlan, binding.getVlanId()); DtoBridge newBridge = getBridge(bridgeId); MidonetBackend b = FuncTest._injector.getInstance(MidonetBackend.class); int vni = 0; try { vni = Await.result(b.store().get(Topology.Network.class, bridgeId), Duration.create(1, SECONDS)).getVni(); <START> } catch (Exception e) { fail("Exception retrieving bridge: " + bridgeId); } <END> assertTrue(vni >= VxgwVni$.MODULE$.seed()); if (firstBinding) { assertEquals(newBridge.getVxLanPortIds().size(), oldBridge.getVxLanPortIds().size() + 1); } else { assertEquals(newBridge.getVxLanPortIds().size(), oldBridge.getVxLanPortIds().size()); } DtoVxLanPort port = null; for (UUID id : newBridge.getVxLanPortIds()) { DtoVxLanPort candidate = getVxLanPort(id); if (candidate.getVtepId().equals(vtep.getId())) { port = candidate; break; } } assertNotNull(port); assertEquals(vtep.getId(), port.getVtepId()); assertEquals(newBridge.getId(), port.getDeviceId()); return binding; }</code><technical_language>Is this worth clutter? If uncaught exception, fail test, fact failed while fetching bridge obvious stack trace</technical_language>

Target:
private DtoVtepBinding addAndVerifyBinding(DtoVtep vtep, UUID bridgeId, String portName, int vlan, boolean firstBinding) { DtoBridge oldBridge = getBridge(bridgeId); DtoVtepBinding binding = postBinding(vtep, makeBinding(vtep.getId(), portName, vlan, bridgeId)); assertEquals(bridgeId, binding.getNetworkId()); assertEquals(portName, binding.getPortName()); assertEquals(vlan, binding.getVlanId()); DtoBridge newBridge = getBridge(bridgeId); MidonetBackend b = FuncTest._injector.getInstance(MidonetBackend.class); int vni = 0; try { vni = Await.result(b.store().get(Topology.Network.class, bridgeId), Duration.create(1, SECONDS)).getVni(); } catch (Exception e) { fail("Exception retrieving bridge: " + bridgeId); } assertTrue(vni >= SequenceDispenser.VxgwVni.seed()); if (firstBinding) { assertEquals(newBridge.getVxLanPortIds().size(), oldBridge.getVxLanPortIds().size() + 1); } else { assertEquals(newBridge.getVxLanPortIds().size(), oldBridge.getVxLanPortIds().size()); } DtoVxLanPort port = null; for (UUID id : newBridge.getVxLanPortIds()) { DtoVxLanPort candidate = getVxLanPort(id); if (candidate.getVtepId().equals(vtep.getId())) { port = candidate; break; } } assertNotNull(port); assertEquals(vtep.getId(), port.getVtepId()); assertEquals(newBridge.getId(), port.getDeviceId()); return binding; }