auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected GraphDatabaseBuilder.DatabaseCreator createDatabaseCreator( final File storeDir, final GraphDatabaseFactoryState state ) { return new GraphDatabaseBuilder.DatabaseCreator() { @Override public GraphDatabaseService newDatabase( Map<String,String> config ) { return newDatabase( Config.defaults( config ) ); } @Override public GraphDatabaseService newDatabase( Config config ) { config.augment( "unsupported.dbms.ephemeral", FALSE ); return new EnterpriseGraphDatabase( storeDir, config, state.databaseDependencies() ); } }; }

Target:
protected GraphDatabaseBuilder.DatabaseCreator createDatabaseCreator( final File storeDir, final GraphDatabaseFactoryState state ) { return new GraphDatabaseBuilder.DatabaseCreator() { @Override public GraphDatabaseService newDatabase( Map<String,String> config ) { return newDatabase( Config.defaults( config ) ); } @Override public GraphDatabaseService newDatabase( Config config ) { config.augment( GraphDatabaseFacadeFactory.Configuration.ephemeral, FALSE ); return new EnterpriseGraphDatabase( storeDir, config, state.databaseDependencies() ); } }; }
Source:
public void handleGetFirmwareVersionResponse(final List<FirmwareVersionDto> firmwareVersions, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Exception occurred while getting device firmware version", e); } this.webServiceResponseMessageSender.send(ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .withDataObject((Serializable) firmwareVersions).build()); }

Target:
public void handleGetFirmwareVersionResponse(final List<FirmwareVersionDto> firmwareVersions, final String deviceIdentification, final String organisationIdentification, final String correlationUid, final String messageType, final ResponseMessageResultType deviceResult, final OsgpException exception) { LOGGER.info("handleResponse for MessageType: {}", messageType); ResponseMessageResultType result = ResponseMessageResultType.OK; OsgpException osgpException = exception; try { if (deviceResult == ResponseMessageResultType.NOT_OK || osgpException != null) { LOGGER.error("Device Response not ok.", osgpException); throw osgpException; } } catch (final Exception e) { LOGGER.error("Unexpected Exception", e); result = ResponseMessageResultType.NOT_OK; osgpException = new TechnicalException(ComponentType.UNKNOWN, "Exception occurred while getting device firmware version", e); } ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(correlationUid).withOrganisationIdentification(organisationIdentification) .withDeviceIdentification(deviceIdentification).withResult(result).withOsgpException(osgpException) .withDataObject((Serializable) firmwareVersions).build(); this.webServiceResponseMessageSender.send(responseMessage); }
Source:
public void findMultipleWithQueryShouldSupportRealAndAliasedPropertyNamesForFieldExclusions() { ObjectWith3AliasedFields obj0 = new ObjectWith3AliasedFields().withId("4711").withProperty1("P10") .withProperty1("P20").withProperty1("P30"); ObjectWith3AliasedFields obj1 = new ObjectWith3AliasedFields().withId("4712").withProperty1("P11") .withProperty1("P21").withProperty1("P31"); template.insert(obj0); template.insert(obj1); Query query = new Query(Criteria.where("id").in(obj0.id, obj1.id)); query.fields() .exclude("property2") .exclude("prop3"); List<ObjectWith3AliasedFields> results = template.find(query, ObjectWith3AliasedFields.class); assertThat(results, is(notNullValue())); assertThat(results.size(), is(2)); ObjectWith3AliasedFields result0 = results.get(0); assertThat(result0, is(notNullValue())); assertThat(result0.id, is(obj0.id)); assertThat(result0.property1, is(obj0.property1)); assertThat(result0.property2, is(nullValue())); assertThat(result0.property3, is(nullValue())); ObjectWith3AliasedFields result1 = results.get(1); assertThat(result1, is(notNullValue())); assertThat(result1.id, is(obj1.id)); assertThat(result1.property1, is(obj1.property1)); assertThat(result1.property2, is(nullValue())); assertThat(result1.property3, is(nullValue())); }

Target:
public void findMultipleWithQueryShouldSupportRealAndAliasedPropertyNamesForFieldExclusions() { ObjectWith3AliasedFields obj0 = new ObjectWith3AliasedFields(); obj0.id = "4711"; obj0.property1 = "P10"; obj0.property2 = "P20"; obj0.property3 = "P30"; ObjectWith3AliasedFields obj1 = new ObjectWith3AliasedFields(); obj1.id = "4712"; obj1.property1 = "P11"; obj1.property2 = "P21"; obj1.property3 = "P31"; template.insert(obj0); template.insert(obj1); Query query = new Query(Criteria.where("id").in(obj0.id, obj1.id)); query.fields() .exclude("property2") .exclude("prop3"); List<ObjectWith3AliasedFields> results = template.find(query, ObjectWith3AliasedFields.class); assertThat(results, is(notNullValue())); assertThat(results.size(), is(2)); ObjectWith3AliasedFields result0 = results.get(0); assertThat(result0, is(notNullValue())); assertThat(result0.id, is(obj0.id)); assertThat(result0.property1, is(obj0.property1)); assertThat(result0.property2, is(nullValue())); assertThat(result0.property3, is(nullValue())); ObjectWith3AliasedFields result1 = results.get(1); assertThat(result1, is(notNullValue())); assertThat(result1.id, is(obj1.id)); assertThat(result1.property1, is(obj1.property1)); assertThat(result1.property2, is(nullValue())); assertThat(result1.property3, is(nullValue())); }
Source:
private String getLastSuccessfulRun(OrcsApi orcsApi) { String toReturn = "Last run time not set"; ArtifactReadable webGroup = orcsApi.getQueryFactory(null).fromBranch(CoreBranches.COMMON).andIsOfType(CoreArtifactTypes.UniversalGroup).andNameEquals( "Web Programs").getResults().getOneOrNull(); if (webGroup != null) { List<String> staticIds = webGroup.getAttributeValues(CoreAttributeTypes.StaticId); for (String staticId : staticIds) { if (staticId.startsWith(LAST_SUCCESSFUL_RUN)) { String[] tokens = staticId.split("="); if (tokens.length == 2) { Date date = new Date(Long.parseLong(tokens[1])); SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); toReturn = String.format("Last successful synchronization:\n%s", dateFormat.format(date)); break; } } } } return toReturn; }

Target:
private String getLastSuccessfulRun(OrcsApi orcsApi) { String toReturn = "Last run time not set"; ArtifactReadable webGroup = orcsApi.getQueryFactory(null).fromBranch(CoreBranches.COMMON).andIds(AtsArtifactToken.WebPrograms).getResults().getExactlyOne(); if (webGroup != null) { List<String> staticIds = webGroup.getAttributeValues(CoreAttributeTypes.StaticId); for (String staticId : staticIds) { if (staticId.startsWith(LAST_SUCCESSFUL_RUN)) { String[] tokens = staticId.split("="); if (tokens.length == 2) { Date date = new Date(Long.parseLong(tokens[1])); SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); toReturn = String.format("Last successful synchronization:\n%s", dateFormat.format(date)); break; } } } } return toReturn; }
Source:
UserDTO getBlockedUser(ProcessDTO process) { UserDTO result = null; if (MetadatenSperrung.isLocked(process.getId())) { String userID = this.msp.getLockBenutzer(process.getId()); try { result = serviceManager.getUserService().findById(Integer.valueOf(userID)); } catch (Exception e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(Helper.getTranslation("userNotFound"), e); } } return result; }

Target:
UserDTO getBlockedUser(ProcessDTO process) { UserDTO result = null; if (MetadatenSperrung.isLocked(process.getId())) { String userID = this.msp.getLockBenutzer(process.getId()); try { result = serviceManager.getUserService().findById(Integer.valueOf(userID)); } catch (DataException | RuntimeException e) { Helper.setErrorMessage(Helper.getTranslation("userNotFound"), logger, e); } } return result; }
Source:
private void validate(ValidationContext vCxt, Graph data, Shape shape, Node focusNode) { if ( ! active ) return; Set<Node> actual = properties(data, focusNode); boolean conforms = true; for ( Node p : actual ) { if ( ! expected.contains(p) && ! ignoredProperties.contains(p) ) { Path path = PathFactory.pathLink(p); G.listSP(data, focusNode, p).forEach(o-> { String msg = toString()+" Property = "+displayStr(p)+" : Object = "+displayStr(o); vCxt.builder().addReportEntry(msg, shape, focusNode, path, o, this); }); } } }

Target:
private void validate(ValidationContext vCxt, Graph data, Shape shape, Node focusNode) { if ( ! active ) return; Set<Node> actual = properties(data, focusNode); for ( Node p : actual ) { if ( ! expected.contains(p) && ! ignoredProperties.contains(p) ) { Path path = PathFactory.pathLink(p); G.listSP(data, focusNode, p).forEach(o-> { String msg = toString()+" Property = "+displayStr(p)+" : Object = "+displayStr(o); vCxt.reportEntry(msg, shape, focusNode, path, o, this); }); } } }
Source:
public Number getValue(int pollerIdx) { AtomicLong n = getNumber(); return n == null ? Double.NaN : n.get(); }

Target:
public Number getValue(int pollerIdx) { return number.get(); }
Source:
public void setIsVolumeTypeChangable(boolean isVolumeTypeChangable) { if (this.isVolumeTypeChangable != isVolumeTypeChangable) { this.isVolumeTypeChangable = isVolumeTypeChangable; onPropertyChanged(new PropertyChangedEventArgs("VolumeFormat")); } }

Target:
public void setIsVolumeTypeChangable(boolean isVolumeTypeChangable) { if (this.isVolumeTypeChangable != isVolumeTypeChangable) { this.isVolumeTypeChangable = isVolumeTypeChangable; onPropertyChanged(new PropertyChangedEventArgs(VOLUME_TYPE)); } }
Source:
public long throttleTime( final ThrottleInfo info ) { if ( adjustmentNeeded() ) { calculateStats( info ); if ( lastSliceTps > limiterTps ) { if ( currentSleepTime.peek() <= 0 ) { currentSleepTime.reset(); } else { currentSleepTime.next(); } } else { if ( currentSleepTime.peek() > 0 ) { currentSleepTime.prev(); } } if ( callback != null ) { callback.onAdjustment( this ); } } return currentSleepTime.peek(); }

Target:
public long throttleTime( final ThrottleInfo info ) { if ( adjustmentNeeded() ) { calculateStats( info ); if ( lastSliceTps > limiterTps ) { if ( currentSleepTime.peek() < 0 ) { currentSleepTime.reset(); } else { currentSleepTime.next(); } } else { if ( currentSleepTime.peek() > 0 ) { currentSleepTime.prev(); } } if ( callback != null ) { callback.onAdjustment( this ); } } return currentSleepTime.peek(); }
Source:
private void setupPipeline(SocketChannel channel, RouteMatcher router) { final ChannelPipeline pipeline = channel.pipeline(); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("decoder", new HttpRequestDecoder() { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable thr) throws Exception { try { if (ctx.channel().isWritable()) { log.debug("request decoder error " + thr.getCause().toString() + " on channel " + ctx.channel().toString()); ctx.channel().write( new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST)) .addListener(ChannelFutureListener.CLOSE); } else { log.debug("channel " + ctx.channel().toString() + " is no longer writeable, not sending 400 response back to client"); } } catch (Exception ex) { log.debug("Can't write to channel " + ctx.channel().toString(), ex); } } }); pipeline.addLast("inflater", new HttpContentDecompressor()); pipeline.addLast("chunkaggregator", new HttpObjectAggregator(Constants.MAX_CONTENT_LENGTH)); pipeline.addLast("encoder2", new HttpResponseDecoder()); pipeline.addLast("handler", new QueryStringDecoderAndRouter(router)); }

Target:
private void setupPipeline(SocketChannel channel, RouteMatcher router) { final ChannelPipeline pipeline = channel.pipeline(); pipeline.addLast("encoder", new HttpResponseEncoder()); pipeline.addLast("decoder", new HttpRequestDecoder() { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable thr) throws Exception { try { if (ctx.channel().isWritable()) { log.debug("request decoder error " + thr.getCause().toString() + " on channel " + ctx.channel().toString()); ctx.channel().write( new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.BAD_REQUEST)) .addListener(ChannelFutureListener.CLOSE); } else { log.debug("channel " + ctx.channel().toString() + " is no longer writeable, not sending 400 response back to client"); } } catch (Exception ex) { log.debug("Can't write to channel " + ctx.channel().toString(), ex); } } }); pipeline.addLast("inflater", new HttpContentDecompressor()); pipeline.addLast("chunkaggregator", new HttpObjectAggregator(httpMaxContentLength)); pipeline.addLast("respdecoder", new HttpResponseDecoder()); pipeline.addLast("handler", new QueryStringDecoderAndRouter(router)); }
Source:
public Block bigintDistinct(@SqlType("array(bigint)") Block array) { if (array.getPositionCount() == 0) { return array; } boolean containsNull = false; TypedSet typedSet = new TypedSet(BIGINT, array.getPositionCount(), "array_distinct"); int distinctCount = 0; if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder distinctElementBlockBuilder = pageBuilder.getBlockBuilder(0); for (int i = 0; i < array.getPositionCount(); i++) { if (array.isNull(i)) { if (!containsNull) { containsNull = true; distinctElementBlockBuilder.appendNull(); distinctCount++; } continue; } if (!typedSet.contains(array, i)) { typedSet.add(array, i); distinctCount++; BIGINT.appendTo(array, i, distinctElementBlockBuilder); } } pageBuilder.declarePositions(distinctCount); return distinctElementBlockBuilder.getRegion(distinctElementBlockBuilder.getPositionCount() - distinctCount, distinctCount); }

Target:
public Block bigintDistinct(@SqlType("array(bigint)") Block array) { if (array.getPositionCount() == 0) { return array; } boolean containsNull = false; LongSet set = new LongOpenHashSet(array.getPositionCount()); int distinctCount = 0; if (pageBuilder.isFull()) { pageBuilder.reset(); } BlockBuilder distinctElementBlockBuilder = pageBuilder.getBlockBuilder(0); for (int i = 0; i < array.getPositionCount(); i++) { if (array.isNull(i)) { if (!containsNull) { containsNull = true; distinctElementBlockBuilder.appendNull(); distinctCount++; } continue; } long value = BIGINT.getLong(array, i); if (!set.contains(value)) { set.add(value); distinctCount++; BIGINT.appendTo(array, i, distinctElementBlockBuilder); } } pageBuilder.declarePositions(distinctCount); return distinctElementBlockBuilder.getRegion(distinctElementBlockBuilder.getPositionCount() - distinctCount, distinctCount); }
Source:
public Stream<RDF4JTriple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) { Resource subj = (Resource) rdf4jTermFactory.asValue(subject); org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate); Value obj = rdf4jTermFactory.asValue(object); RepositoryConnection conn = getRepositoryConnection(); RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contextFilter); return Iterations.stream(statements).map(this::asTripleLike); }

Target:
public Stream<RDF4JTriple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) { Resource subj = (Resource) rdf4jTermFactory.asValue(subject); org.eclipse.rdf4j.model.IRI pred = (org.eclipse.rdf4j.model.IRI) rdf4jTermFactory.asValue(predicate); Value obj = rdf4jTermFactory.asValue(object); RepositoryConnection conn = getRepositoryConnection(); Stream<RDF4JTriple> stream = null; try { RepositoryResult<Statement> statements = conn.getStatements(subj, pred, obj, includeInferred, contextMask); stream = Iterations.stream(statements).map(this::asTripleLike); } finally { if (stream == null) { conn.close(); } } return stream.onClose(conn::close); }
Source:
private void initFailedQueriesEventSubscribers() { String emailRecipients = prop.getProperty(NotificationProperties.FAILED_QUERIES_NOTIFICATION_RECIPIENTS, true); if (StringUtils.isEmpty(emailRecipients)) { return; } List<EventAuditLogSubscriber> failedQueriesEventSubscribers = new LinkedList<>(); for (String email:emailRecipients.split(",")){ EventAuditLogSubscriber eals = new EventAuditLogSubscriber(); eals.setevent_type(1); eals.setevent_up_name("DATABASE_UNREACHABLE"); eals.setmethod_id(EventNotificationMethods.EMAIL.getValue()); eals.setmethod_address(StringUtils.strip(email)); eals.setmessage("Failed to query for notifications. Database Connection refused."); eals.setseverity(AuditLogSeverity.ERROR.getValue()); failedQueriesEventSubscribers.add(eals); } this.failedQueriesEventSubscribers = failedQueriesEventSubscribers; }

Target:
private void initFailedQueriesEventSubscribers() { String emailRecipients = prop.getProperty(NotificationProperties.FAILED_QUERIES_NOTIFICATION_RECIPIENTS, true); if (StringUtils.isEmpty(emailRecipients)) { return; } List<EventAuditLogSubscriber> failedQueriesEventSubscribers = new LinkedList<>(); for (String email:emailRecipients.split(",")){ EventAuditLogSubscriber eals = new EventAuditLogSubscriber(); eals.setevent_type(MessageHelper.MessageType.alertMessage.getEventType()); eals.setevent_up_name("DATABASE_UNREACHABLE"); eals.setmethod_id(EventNotificationMethods.EMAIL.getValue()); eals.setmethod_address(StringUtils.strip(email)); eals.setmessage("Failed to query for notifications. Database Connection refused."); eals.setseverity(AuditLogSeverity.ERROR.getValue()); failedQueriesEventSubscribers.add(eals); } this.failedQueriesEventSubscribers = failedQueriesEventSubscribers; }
Source:
public void verifySuggestVideoOrArticleButtonClickable() { waitForElementClickableByElement(submitButton); PageObjectLogging.log("VerifySuggestVideoOrArticleButtonClickable", "Verify that Suggest Video or Article submit button is enabled", true); }

Target:
public void verifySuggestVideoOrArticleButtonClickable() { waitForElementClickableByElement(submitButton); PageObjectLogging.log( "verifySuggestVideoOrArticleButtonClickable", "Verify that Suggest Video or Article submit button is enabled", true ); }
Source:
public void setCustomName(String name) { throw new UnsupportedOperationException("Cannot set the custom name a player"); }

Target:
public void setCustomName(String name) { throw new UnsupportedOperationException("Cannot set the custom name of a player"); }
Source:
public XmlEntry(int baseQuark, int displayQuark, @NonNull ITmfTrace trace, String name, long startTime, long endTime, EntryDisplayType type, @NonNull ITmfStateSystem ss, Element entryElement) { super(name, startTime, endTime); fTrace = trace; fType = type; fBaseQuark = baseQuark; fDisplayQuark = displayQuark; fSs = ss; fElement = entryElement; String displayText = entryElement.getAttribute(TmfXmlUiStrings.DISPLAY_TEXT); fShowText = (displayText.toLowerCase().equals("true") ? true : false); List<Element> elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.PARENT_ELEMENT); if (elements.size() > 0) { fParentId = getFirstValue(elements.get(0)); } else { fParentId = EMPTY_STRING; } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.NAME_ELEMENT); if (elements.size() > 0) { String nameFromSs = getFirstValue(elements.get(0)); if (!nameFromSs.isEmpty()) { setName(nameFromSs); } } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.ID_ELEMENT); if (elements.size() > 0) { fId = getFirstValue(elements.get(0)); } else { fId = name; } }

Target:
public XmlEntry(int baseQuark, int displayQuark, @NonNull ITmfTrace trace, String name, long startTime, long endTime, EntryDisplayType type, @NonNull ITmfStateSystem ss, Element entryElement) { super(name, startTime, endTime); fTrace = trace; fType = type; fBaseQuark = baseQuark; fDisplayQuark = displayQuark; fSs = ss; fElement = entryElement; String displayText = entryElement.getAttribute(TmfXmlUiStrings.DISPLAY_TEXT); fShowText = Boolean.valueOf(displayText); List<Element> elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.PARENT_ELEMENT); if (elements.size() > 0) { fParentId = getFirstValue(elements.get(0)); } else { fParentId = EMPTY_STRING; } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.NAME_ELEMENT); if (elements.size() > 0) { String nameFromSs = getFirstValue(elements.get(0)); if (!nameFromSs.isEmpty()) { setName(nameFromSs); } } elements = TmfXmlUtils.getChildElements(fElement, TmfXmlUiStrings.ID_ELEMENT); if (elements.size() > 0) { fId = getFirstValue(elements.get(0)); } else { fId = name; } }
Source:
private ArrayList<Ds3Object> getDs3Objects(final Iterable<Path> filteredObjects) throws IOException { final ArrayList<Ds3Object> objects = new ArrayList<>(); for (final Path path : filteredObjects) { objects.add(new Ds3Object( SyncUtils.GetFileName(inputDirectory, path), SyncUtils.GetFileSize(path))); } return objects; }

Target:
private ImmutableList<Ds3Object> getDs3Objects(final Iterable<Path> filteredObjects) throws IOException { final ImmutableList.Builder<Ds3Object> objectsBuilder = ImmutableList.builder(); for (final Path path : filteredObjects) { objectsBuilder.add(new Ds3Object( Utils.getFileName(inputDirectory, path), Utils.getFileSize(path))); } return objectsBuilder.build(); }
Source:
protected Map<Integer, IVariableFacade> getVariableCache() { if(compositeVariableCache == null) { CompositeMap<Integer, IVariableFacade> compositeMap = new CompositeMap<>(); for(Iterator<DimPos> it = variableContainerPositions.iterator(); it.hasNext();) { DimPos dimPos = it.next(); IVariableContainer variableContainer = TileHelpers.getCapability(dimPos, null, VariableContainerConfig.CAPABILITY); if(variableContainer != null) { compositeMap.addElement(variableContainer.getVariableCache()); } else { IntegratedDynamics.clog(Level.ERROR, "The variable container at " + dimPos + " was invalid, skipping."); it.remove(); } } for(PartPos partPos : partPositions.valueCollection()){ IPartContainer partContainer = PartHelpers.getPartContainer(partPos.getPos(), partPos.getSide()); IVariableContainer variableContainer = partContainer.getCapability(VariableContainerConfig.CAPABILITY, partPos.getSide()); if (variableContainer != null) compositeMap.addElement(variableContainer.getVariableCache()); } compositeVariableCache = compositeMap; } return compositeVariableCache; }

Target:
protected Map<Integer, IVariableFacade> getVariableCache() { if(compositeVariableCache == null) { CompositeMap<Integer, IVariableFacade> compositeMap = new CompositeMap<>(); for(Iterator<DimPos> it = variableContainerPositions.iterator(); it.hasNext();) { DimPos dimPos = it.next(); IVariableContainer variableContainer = TileHelpers.getCapability(dimPos, null, VariableContainerConfig.CAPABILITY); if(variableContainer != null) { compositeMap.addElement(variableContainer.getVariableCache()); } else { IntegratedDynamics.clog(Level.ERROR, "The variable container at " + dimPos + " was invalid, skipping."); it.remove(); } } for(PartPos partPos : partPositions.valueCollection()) { IPartContainer partContainer = PartHelpers.getPartContainer(partPos.getPos(), partPos.getSide()); IVariableContainer variableContainer = partContainer.getCapability(VariableContainerConfig.CAPABILITY, partPos.getSide()); if (variableContainer != null) { compositeMap.addElement(variableContainer.getVariableCache()); } } compositeVariableCache = compositeMap; } return compositeVariableCache; }
Source:
public static JsonElement toGsonElement(JsonNode jsonNode) { if (jsonNode.isArray()) { if (jsonNode instanceof GsonJsonArray) { return ((GsonJsonArray) jsonNode).getJsonArray(); } throw new IllegalArgumentException("JsonNode is an array but isn't GsonJsonArray."); } else if (jsonNode.isNull()) { if (jsonNode instanceof GsonJsonNull) { return ((GsonJsonNull) jsonNode).getJsonNull(); } throw new IllegalArgumentException("JsonNode is a null but isn't GsonJsonNull."); } else if (jsonNode.isObject()) { if (jsonNode instanceof GsonJsonObject) { return ((GsonJsonObject) jsonNode).getJsonObject(); } throw new IllegalArgumentException("JsonNode is an array but isn't GsonJsonObject."); } else if (jsonNode.isValue()) { if (jsonNode instanceof GsonJsonValue) { return ((GsonJsonValue) jsonNode).getJsonPrimitive(); } throw new IllegalArgumentException("JsonNode is a value but isn't GsonJsonValue."); } throw new IllegalArgumentException("Unknown JsonNode type."); }

Target:
public static JsonElement toGsonElement(JsonNode jsonNode) { if (jsonNode.isArray()) { if (jsonNode instanceof GsonJsonArray) { return ((GsonJsonArray) jsonNode).getJsonArray(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is an array but isn't GsonJsonArray.")); } else if (jsonNode.isNull()) { if (jsonNode instanceof GsonJsonNull) { return ((GsonJsonNull) jsonNode).getJsonNull(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is a null but isn't GsonJsonNull.")); } else if (jsonNode.isObject()) { if (jsonNode instanceof GsonJsonObject) { return ((GsonJsonObject) jsonNode).getJsonObject(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is an array but isn't GsonJsonObject.")); } else if (jsonNode.isValue()) { if (jsonNode instanceof GsonJsonPrimitive) { return ((GsonJsonPrimitive) jsonNode).getJsonPrimitive(); } throw LOGGER.logExceptionAsError( new IllegalArgumentException("JsonNode is a value but isn't GsonJsonPrimitive.")); } throw LOGGER.logExceptionAsError(new IllegalArgumentException("Unknown JsonNode type.")); }
Source:
public List<Long> getDownloadedVideoDmIdsForSection(String enrollmentId, String chapter, String section , final DataCallback<List<Long>> callback ) { DbOperationGetColumn<Long> op = new DbOperationGetColumn<Long>(true,DbStructure.Table.DOWNLOADS, new String[]{DbStructure.Column.DM_ID}, DbStructure.Column.DOWNLOADED + "=? AND "+ DbStructure.Column.EID + "=? AND " + DbStructure.Column.CHAPTER + "=? AND " + DbStructure.Column.SECTION + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[] {String.valueOf(DownloadedState.DOWNLOADED.ordinal()), enrollmentId, chapter, section, username()}, null, Long.class); op.setCallback(callback); return enqueue(op); }

Target:
public long[] getDownloadedVideoDmIdsForSection(String enrollmentId, String chapter, String section, final DataCallback<List<Long>> callback) { DbOperationGetColumn<Long> op = new DbOperationGetColumn<Long>(true, DbStructure.Table .DOWNLOADS, new String[]{DbStructure.Column.DM_ID}, DbStructure.Column.DOWNLOADED + "=? AND " + DbStructure.Column.EID + "=? AND " + DbStructure.Column.CHAPTER + "=? AND " + DbStructure.Column.SECTION + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[]{String.valueOf(DownloadedState.DOWNLOADED.ordinal()), enrollmentId, chapter, section, username()}, null, Long.class); op.setCallback(callback); List<Long> downloadedList = enqueue(op); if (callback != null) { return null; } else { return ArrayUtils.toPrimitive(downloadedList.toArray(new Long[downloadedList.size()])); } }
Source:
static void send(List<Event> events) { while (!events.isEmpty()) { List<Event> eventsList = new ArrayList<>(); String stream = events.get(0).getStream(); for (Event event : events) { if (event.getStream().equals(stream)) { eventsList.add(event); } } events.removeAll(eventsList); postEvent(getStreamConfig(stream), eventsList); } }

Target:
static void send(List<Event> events) { Map<String, ArrayList<Event>> eventsByStream = new HashMap<>(); for (Event event : events) { String stream = event.getStream(); if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) { eventsByStream.put(stream, new ArrayList<>()); } eventsByStream.get(stream).add(event); } for (String stream : eventsByStream.keySet()) { postEvents(getStreamConfig(stream), eventsByStream.get(stream)); } }
Source:
protected HttpWebRequest validateAndEmitRequest() throws ServiceLocalException, Exception { this.validate(); HttpWebRequest request = this.buildEwsHttpWebRequest(); try { return this.getEwsHttpWebResponse(request); } catch (HttpErrorException e) { try { processWebException(e, request); } finally { request.close(); } throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } }

Target:
protected HttpWebRequest validateAndEmitRequest() throws ServiceLocalException, Exception { this.validate(); HttpWebRequest request = this.buildEwsHttpWebRequest(); try { try { return this.getEwsHttpWebResponse(request); } catch (HttpErrorException e) { processWebException(e, request); throw new ServiceRequestException(String.format(Strings.ServiceRequestFailed, e.getMessage()), e); } } catch (Exception e) { try { request.close(); } catch (Exception e2) { } throw e; } }
Source:
private double computeLoss(final List<LassoData> data) { double loss = 0; double reg = 0; for (final LassoData entry : data) { final Vector feature = entry.getFeature(); final double value = entry.getValue(); final double prediction = predict(feature); loss += (value - prediction) * (value - prediction); } for (int i = 0; i < numFeatures; ++i) { reg += newModel.get(i); } loss = 1.0 / (2 * data.size()) * loss + lambda * reg; return loss; }

Target:
private double computeLoss(final List<LassoData> data) { double squaredErrorSum = 0; double reg = 0; for (final LassoData entry : data) { final Vector feature = entry.getFeature(); final double value = entry.getValue(); final double prediction = predict(feature); squaredErrorSum += (value - prediction) * (value - prediction); } for (int i = 0; i < numFeatures; ++i) { reg += newModel.get(i); } final double loss = 1.0 / (2 * data.size()) * squaredErrorSum + lambda * reg; return loss; }
Source:
public Object valueToBson(Object value) { if (value instanceof State) { return stateToBson((State) value); } else if (value instanceof List) { @SuppressWarnings("unchecked") List<Object> values = (List<Object>) value; return listToBson(values); } else if (value instanceof Object[]) { return listToBson(Arrays.asList((Object[]) value)); } else if (value instanceof Map) { if (((Map) value).size() == 1) { Map<DBSQueryOperator, HashSet<String>> valueMap = (Map) value; if (valueMap.containsKey(DBSQueryOperator.IN)) { value = Collections.singletonMap(IN, valueMap.get(DBSQueryOperator.IN)); } else if (valueMap.containsKey(DBSQueryOperator.NOT_IN)) { value = Collections.singletonMap(NIN, valueMap.get(DBSQueryOperator.NOT_IN)); } } } return serializableToBson(value); }

Target:
public Object valueToBson(Object value) { if (value instanceof State) { return stateToBson((State) value); } else if (value instanceof List) { @SuppressWarnings("unchecked") List<Object> values = (List<Object>) value; return listToBson(values); } else if (value instanceof Object[]) { return listToBson(Arrays.asList((Object[]) value)); } else { return serializableToBson(value); } }
Source:
public void deleteGoal(final Goal goal) { Log.d(TAG, "Deleting Goal: " + goal.getTitle()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage("You are about to permanently remove this") .setTitle("Delete Goal?") .setNegativeButton(R.string.picker_cancel, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { removeGoal(goal); dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); }

Target:
public void deleteGoal(final Goal goal) { Log.d(TAG, "Deleting Goal: " + goal.getTitle()); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(getText(R.string.goal_dialog_delete_message)) .setTitle(getText(R.string.goal_dialog_delete_title)) .setNegativeButton(R.string.picker_cancel, new DialogInterface.OnClickListener(){ public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }) .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { removeGoal(goal); dialog.dismiss(); } }); AlertDialog dialog = builder.create(); dialog.show(); }
Source:
public StubbedInvocationMatcher addAnswer(Answer answer, boolean isConsecutive) { Invocation invocation = invocationForStubbing.getInvocation(); mockingProgress().stubbingCompleted(); if ((Answer<?>) answer instanceof ValidableAnswer) { ((ValidableAnswer) (Answer<?>) answer).validateFor(invocation); } synchronized (stubbed) { if (isConsecutive) { stubbed.getFirst().addAnswer(answer); } else { stubbed.addFirst(new StubbedInvocationMatcher(invocationForStubbing, answer)); } return stubbed.getFirst(); } }

Target:
public StubbedInvocationMatcher addAnswer(Answer answer, boolean isConsecutive) { Invocation invocation = invocationForStubbing.getInvocation(); mockingProgress().stubbingCompleted(); if (answer instanceof ValidableAnswer) { ((ValidableAnswer) answer).validateFor(invocation); } synchronized (stubbed) { if (isConsecutive) { stubbed.getFirst().addAnswer(answer); } else { stubbed.addFirst(new StubbedInvocationMatcher(invocationForStubbing, answer)); } return stubbed.getFirst(); } }
Source:
public Attributes searchOne(String filter, Object... args) throws NamingException { NamingEnumeration<SearchResult> r = search(filter,args); try { if (r.hasMore()) { SearchResult searchResult = r.next(); Attributes attrs = searchResult.getAttributes(); attrs.put("distinguishedNameFormatted", searchResult.getNameInNamespace()); LOG.log(Level.FINER, "found {0}", attrs); return attrs; } else { LOG.finer("no result"); } return null; } finally { r.close(); } }

Target:
public Attributes searchOne(String filter, Object... args) throws NamingException { NamingEnumeration<SearchResult> r = search(filter,args); try { if (r.hasMore()) { SearchResult searchResult = r.next(); Attributes attrs = searchResult.getAttributes(); attrs.put(ActiveDirectoryUnixAuthenticationProvider.DN_FORMATTED, searchResult.getNameInNamespace()); LOG.log(Level.FINER, "found {0}", attrs); return attrs; } else { LOG.finer("no result"); } return null; } finally { r.close(); } }
Source:
private void copyText(TaggedValuePointable tvp, NodeTreePointable ntp, IMutableValueStorage mvs) throws IOException { TextNodeBuilder tnb = new TextNodeBuilder(); VoidPointable vp = ppool.takeOne(VoidPointable.class); TextOrCommentNodePointable tcnp = ppool.takeOne(TextOrCommentNodePointable.class); tvp.getValue(tcnp); tcnp.getValue(ntp, vp); tnb.reset(mvs); tnb.setValue(vp); ppool.giveBack(vp); ppool.giveBack(tcnp); }

Target:
private void copyText(TaggedValuePointable tvp, NodeTreePointable ntp, IMutableValueStorage mvs) throws IOException { VoidPointable vp = ppool.takeOne(VoidPointable.class); TextOrCommentNodePointable tcnp = ppool.takeOne(TextOrCommentNodePointable.class); tvp.getValue(tcnp); tcnp.getValue(ntp, vp); tnb.reset(mvs); tnb.setValue(vp); ppool.giveBack(vp); ppool.giveBack(tcnp); }
Source:
public void doLaunch(Context context, View v) { if (v == null) { if (togglesHandler == null) { togglesHandler = new TogglesHandler(context); } togglesHandler.setState(togglePojo, !togglesHandler.getState(togglePojo)); } else { final CompoundButton toggleButton = (CompoundButton) v .findViewById(R.id.item_toggle_action_toggle); if (toggleButton.isEnabled()) { toggleButton.performClick(); } } }

Target:
public void doLaunch(Context context, View v) { if (v == null) { if (togglesHandler == null) { togglesHandler = new TogglesHandler(context); } String msg = context.getResources().getString(togglesHandler.getState(togglePojo) ? R.string.toggles_off : R.string.toggles_on); togglesHandler.setState(togglePojo, !togglesHandler.getState(togglePojo)); Toast.makeText(((MainActivity) context), String.format(msg, " " + this.pojo.displayName), Toast.LENGTH_SHORT).show(); } else { final CompoundButton toggleButton = (CompoundButton) v .findViewById(R.id.item_toggle_action_toggle); if (toggleButton.isEnabled()) { toggleButton.performClick(); } } }
Source:
public Set<StoreKey> findMissingKeys(List<StoreKey> keys) throws StoreException { checkStarted(); Set<StoreKey> missingKeys = new HashSet<>(); try { for (StoreKey key : keys) { BlobId blobId = (BlobId) key; if (cloudDestination.doesBlobExist(blobId) == false) { missingKeys.add(key); } } } catch (Exception ex) { throw new StoreException(ex, StoreErrorCodes.IOError); } return missingKeys; }

Target:
public Set<StoreKey> findMissingKeys(List<StoreKey> keys) throws StoreException { checkStarted(); Set<StoreKey> missingKeys = new HashSet<>(); try { for (StoreKey key : keys) { BlobId blobId = (BlobId) key; if (!cloudDestination.doesBlobExist(blobId)) { missingKeys.add(key); } } } catch (CloudStorageException ex) { throw new StoreException(ex, StoreErrorCodes.IOError); } return missingKeys; }
Source:
protected void executeQueryCommand() { java.util.ArrayList<storage_domains> result = new java.util.ArrayList<storage_domains>(); VmTemplate vmTemplate = DbFacade.getInstance().getVmTemplateDAO() .get(getParameters().getId()); if (vmTemplate != null && vmTemplate.getstorage_pool_id() != null) { List<DiskImage> templateDisks = GetTemplateDisks(); if (templateDisks.size() > 0) { List<Guid> domains = (List<Guid>) DbFacade.getInstance() .getStorageDomainDAO() .getAllStorageDomainsByImageGroup(templateDisks.get(0).getimage_group_id().getValue()); for (Guid domainId : domains) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id().getValue()); if (domain != null) { result.add(domain); } } } } getQueryReturnValue().setReturnValue(result); }

Target:
protected void executeQueryCommand() { java.util.ArrayList<storage_domains> result = new java.util.ArrayList<storage_domains>(); VmTemplate vmTemplate = DbFacade.getInstance().getVmTemplateDAO() .get(getParameters().getId()); if (vmTemplate != null && vmTemplate.getstorage_pool_id() != null) { List<DiskImage> templateDisks = getTemplateDisks(); if (templateDisks.size() > 0) { List<Guid> domains = (List<Guid>) DbFacade.getInstance() .getStorageDomainDAO() .getAllStorageDomainsByImageGroup(templateDisks.get(0).getimage_group_id().getValue()); for (Guid domainId : domains) { storage_domains domain = DbFacade.getInstance().getStorageDomainDAO().getForStoragePool(domainId, vmTemplate.getstorage_pool_id().getValue()); if (domain != null) { result.add(domain); } } } } getQueryReturnValue().setReturnValue(result); }
Source:
public synchronized void put(ContentEvent event) { ThreadsProcessingItem pi; for (DestinationPIWrapper destination:listDestination) { pi = (ThreadsProcessingItem) destination.getProcessingItem(); counter++; if (counter >= maxCounter) counter = 0; switch (destination.getEventAllocationType()) { case SHUFFLE: pi.processEvent(event, counter%destination.getParallelism()); break; case GROUP_BY_KEY: HashCodeBuilder hb = new HashCodeBuilder(); hb.append(event.getKey()); int key = hb.build() % destination.getParallelism(); pi.processEvent(event, key); break; case BROADCAST: for (int p = 0; p < destination.getParallelism(); p++) { pi.processEvent(event, p); } break; } } }

Target:
public synchronized void put(ContentEvent event) { this.put(event, this.getNextCounter()); }
Source:
public Map<ObjectType, Optional<DslElementSyntax>> resolveSubTypes(ObjectType type) { ImmutableMap.Builder<ObjectType, Optional<DslElementSyntax>> mapBuilder = ImmutableMap.builder(); for (ObjectType subType : dslResolvingContext.getTypeCatalog().getSubTypes(type)) { subType.getAnnotation(TypeIdAnnotation.class).map(TypeIdAnnotation::getValue).ifPresent( typeId -> dslResolvingContext .getTypeCatalog() .getDeclaringExtension(typeId) .ifPresent(extensionName -> dslResolvingContext .getExtension(extensionName) .ifPresent(extensionModel -> mapBuilder .put(subType, dslSyntaxResolversByExtension .get(extensionModel) .resolve(subType))))); } return mapBuilder.build(); }

Target:
public Map<ObjectType, Optional<DslElementSyntax>> resolveSubTypes(ObjectType type) { ImmutableMap.Builder<ObjectType, Optional<DslElementSyntax>> mapBuilder = ImmutableMap.builder(); for (ObjectType subType : dslResolvingContext.getTypeCatalog().getSubTypes(type)) { Optional<String> typeId = subType.getAnnotation(TypeIdAnnotation.class).map(TypeIdAnnotation::getValue); if (typeId.isPresent()) { Optional<String> declaringExtension = dslResolvingContext.getTypeCatalog().getDeclaringExtension(typeId.get()); if (declaringExtension.isPresent()) { dslResolvingContext.getExtension(declaringExtension.get()) .ifPresent(extensionModel -> mapBuilder.put(subType, dslSyntaxResolversByExtension.get(extensionModel).resolve(subType))); } } } return mapBuilder.build(); }
Source:
public synchronized void subscribe(Subscription subscription) { TenantsSubscriptionsHolder tenantSubscriptions = subscriptions.get(subscription.getMetric().getTenant()); if (tenantSubscriptions == null) { tenantSubscriptions = new TenantsSubscriptionsHolder(); subscriptions.put(subscription.getMetric().getTenant(), tenantSubscriptions); } if (tenantSubscriptions.getSubscriptions().get(subscription) != null) { throw new SubscriptionAlreadyExistsException(); } subscription.forecaster().setPredictionListener(predictionListener); List<DataPoint> points = restMetricsClient.loadPoints(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); subscription.forecaster().learn(points); tenantSubscriptions.getSubscriptions().put(subscription.getMetric().getMetricId(), subscription); Logger.LOGGER.subscribe(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); }

Target:
public void subscribe(Subscription subscription) { TenantsSubscriptionsHolder tenantSubscriptions = null; synchronized (subscriptions) { tenantSubscriptions = subscriptions.get(subscription.getMetric().getTenant()); if (tenantSubscriptions == null) { tenantSubscriptions = new TenantsSubscriptionsHolder(); subscriptions.put(subscription.getMetric().getTenant(), tenantSubscriptions); } if (tenantSubscriptions.getSubscriptions().get(subscription.getMetric().getMetricId()) != null) { throw new SubscriptionAlreadyExistsException(); } } subscription.forecaster().setPredictionListener(predictionListener); List<DataPoint> points = restMetricsClient.loadPoints(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); subscription.forecaster().learn(points); tenantSubscriptions.getSubscriptions().put(subscription.getMetric().getMetricId(), subscription); Logger.LOGGER.subscribe(subscription.getMetric().getMetricId(), subscription.getMetric().getTenant()); }
Source:
public Block copyPositions(int[] positions, int offset, int length) { checkValidPositionsArray(positions, offset, length); int[] newOffsets = new int[length + 1]; boolean[] newRowIsNull = new boolean[length]; List<Integer> fieldBlockPositions = new ArrayList<>(length); for (int i = 0; i < length; i++) { int position = positions[offset + i]; if (isNull(position)) { newRowIsNull[i] = true; newOffsets[i + 1] = newOffsets[i]; } else { newOffsets[i + 1] = newOffsets[i] + 1; fieldBlockPositions.add(getFieldBlockOffset(position)); } } Block[] newBlocks = new Block[numFields]; for (int i = 0; i < numFields; i++) { newBlocks[i] = getFieldBlocks()[i].copyPositions(fieldBlockPositions); } return new RowBlock(0, length, newRowIsNull, newOffsets, newBlocks); }

Target:
public Block copyPositions(int[] positions, int offset, int length) { checkValidPositionsArray(positions, offset, length); int[] newOffsets = new int[length + 1]; boolean[] newRowIsNull = new boolean[length]; IntArrayList fieldBlockPositions = new IntArrayList(length); for (int i = 0; i < length; i++) { int position = positions[offset + i]; if (isNull(position)) { newRowIsNull[i] = true; newOffsets[i + 1] = newOffsets[i]; } else { newOffsets[i + 1] = newOffsets[i] + 1; fieldBlockPositions.add(getFieldBlockOffset(position)); } } Block[] newBlocks = new Block[numFields]; for (int i = 0; i < numFields; i++) { newBlocks[i] = getFieldBlocks()[i].copyPositions(fieldBlockPositions.elements(), 0, fieldBlockPositions.size()); } return new RowBlock(0, length, newRowIsNull, newOffsets, newBlocks); }
Source:
private void showExportContentDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.export_your_content); String email = AccountHelper.getDefaultAccount().getEmail(); builder.setMessage(getString(R.string.export_your_content_message, email)); builder.setPositiveButton(R.string.site_settings_export_content_title, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { exportSite(); } }); builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); } }); builder.show(); }

Target:
private void showExportContentDialog() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.export_your_content); String email = AccountHelper.getDefaultAccount().getEmail(); builder.setMessage(getString(R.string.export_your_content_message, email)); builder.setPositiveButton(R.string.site_settings_export_content_title, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { exportSite(); } }); builder.setNegativeButton(R.string.cancel, null); builder.show(); }
Source:
public URL getDownloadLink() { try { return new URL("<LINK_0>"); } catch (Throwable t) { t.printStackTrace(); } return null; }

Target:
public URL getDownloadLink() { try { return new URL(Configuration.LIBRARIES_DOWNLOAD + "/JPushBullet"); } catch (Throwable t) { t.printStackTrace(); } return null; }
Source:
private void revision(SafeHtmlBuilder sb, int index, RevisionInfo r) { CommitInfo c = r.commit(); sb.openTr(); if (revision.equals(r.name())) { sb.setStyleName(style.current()); } sb.openTd() .setStyleName(style.legacy_id()) .append(r._number()); if (r.has_draft_comments()) { sb.append(" ..."); } if (r.draft()) { sb.append(" ").append(Resources.C.draft()); } sb.closeTd(); sb.openTd() .setStyleName(style.commit()) .openAnchor() .setAttribute("href", "#" + url(r)) .setAttribute("onclick", OPEN + "(event," + index + ")") .append(r.name().substring(0, 10)) .closeAnchor() .closeTd(); sb.openTd() .append(FormatUtil.shortFormatDayTime(c.committer().date())) .closeTd(); String an = c.author() != null ? c.author().name() : null; String cn = c.committer() != null ? c.committer().name() : null; sb.openTd(); sb.append(an); if (!"".equals(an) && !"".equals(cn) && !an.equals(cn)) { sb.append(" / ").append(cn); } sb.closeTd(); sb.closeTr(); }

Target:
private void revision(SafeHtmlBuilder sb, int index, RevisionInfo r) { CommitInfo c = r.commit(); sb.openTr(); if (revision.equals(r.name())) { sb.setStyleName(style.current()); } sb.openTd() .setStyleName(style.legacy_id()) .append(r._number()); if (r.draft()) { sb.append(" ").append(Resources.C.draft()); } if (r.has_draft_comments()) { sb.append(" ") .openSpan() .addStyleName(style.draft_comment()) .append(new ImageResourceRenderer() .render(Gerrit.RESOURCES.draftComments())) .closeSpan(); } sb.closeTd(); sb.openTd() .setStyleName(style.commit()) .openAnchor() .setAttribute("href", "#" + url(r)) .setAttribute("onclick", OPEN + "(event," + index + ")") .append(r.name().substring(0, 10)) .closeAnchor() .closeTd(); sb.openTd() .append(FormatUtil.shortFormatDayTime(c.committer().date())) .closeTd(); String an = c.author() != null ? c.author().name() : null; String cn = c.committer() != null ? c.committer().name() : null; sb.openTd(); sb.append(an); if (!"".equals(an) && !"".equals(cn) && !an.equals(cn)) { sb.append(" / ").append(cn); } sb.closeTd(); sb.closeTr(); }
Source:
public void afterCompletion(int status) { try { manager.disposeRuntimeEngine(runtime); } catch (Throwable e) { logger.warn("Could not dispose runtime engine", e); } }

Target:
public void afterCompletion(int status) { try { manager.disposeRuntimeEngine(runtime); } catch (Throwable e) { logger.debug("Could not dispose runtime engine", e); } }