auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void cloneShouldOnlyWorksWithEmptyRepos() throws IOException { final File parentFolder = createTempDirectory(); final File gitSource = new File(parentFolder, SOURCE_GIT + ".git"); final File gitTarget = new File(parentFolder, TARGET_GIT + ".git"); final Git origin = setupGitRepo(gitSource); final Git cloned = new Clone(gitTarget, gitSource.getAbsolutePath(), false, CredentialsProvider.getDefault(), null).execute().get(); assertThat(cloned).isNotNull(); assertThat(new ListRefs(cloned.getRepository()).execute()).hasSize(2); assertEquals(new ListRefs(cloned.getRepository()).execute().size(), new ListRefs(origin.getRepository()).execute().size()); final Git clonedWithNoEmptyRepo = new Clone(gitTarget, gitSource.getAbsolutePath(), false, CredentialsProvider.getDefault(), null).execute().get(); }

Target:
public void cloneShouldOnlyWorksWithEmptyRepos() throws IOException { final File parentFolder = createTempDirectory(); final File gitSource = new File(parentFolder, SOURCE_GIT + ".git"); final File gitTarget = new File(parentFolder, TARGET_GIT + ".git"); final Git origin = setupGitRepo(gitSource); final Git cloned = new Clone(gitTarget, gitSource.getAbsolutePath(), false, CredentialsProvider.getDefault(), null).execute().get(); assertThat(cloned).isNotNull(); assertThat(new ListRefs(cloned.getRepository()).execute()).hasSize(2); assertEquals(new ListRefs(cloned.getRepository()).execute().size(), new ListRefs(origin.getRepository()).execute().size()); assertThatThrownBy(() -> new Clone(gitTarget, gitSource.getAbsolutePath(), false, CredentialsProvider.getDefault(), null).execute().get()) .isInstanceOf(Clone.CloneException.class); }
Source:
private Optional<AggregationBuilder> getCreatedAtFacet(IssueQuery query, Map<String, QueryBuilder> filters, QueryBuilder esQuery) { long startTime; Date createdAfter = query.createdAfter(); if (createdAfter == null) { Optional<Long> minDate = getMinCreatedAt(filters, esQuery); if (!minDate.isPresent()) { return Optional.empty(); } startTime = minDate.get(); } else { startTime = createdAfter.getTime(); } Date createdBefore = query.createdBefore(); long endTime = createdBefore == null ? system.now() : createdBefore.getTime(); Duration timeSpan = new Duration(startTime, endTime); DateHistogramInterval bucketSize = DateHistogramInterval.YEAR; if (timeSpan.isShorterThan(TWENTY_DAYS)) { bucketSize = DateHistogramInterval.DAY; } else if (timeSpan.isShorterThan(TWENTY_WEEKS)) { bucketSize = DateHistogramInterval.WEEK; } else if (timeSpan.isShorterThan(TWENTY_MONTHS)) { bucketSize = DateHistogramInterval.MONTH; } AggregationBuilder dateHistogram = AggregationBuilders.dateHistogram(PARAM_CREATED_AT) .field(IssueIndexDefinition.FIELD_ISSUE_FUNC_CREATED_AT) .dateHistogramInterval(bucketSize) .minDocCount(0L) .format("yyyy-MM-dd'T'HH:mm:ssZZ") .timeZone(DateTimeZone.forOffsetMillis(system.getDefaultTimeZone().getRawOffset())) .extendedBounds(new ExtendedBounds(startTime, endTime - 1L)); addEffortAggregationIfNeeded(query, dateHistogram); return Optional.of(dateHistogram); }

Target:
private Optional<AggregationBuilder> getCreatedAtFacet(IssueQuery query, Map<String, QueryBuilder> filters, QueryBuilder esQuery) { long startTime; Date createdAfter = query.createdAfter(); if (createdAfter == null) { Optional<Long> minDate = getMinCreatedAt(filters, esQuery); if (!minDate.isPresent()) { return Optional.empty(); } startTime = minDate.get(); } else { startTime = createdAfter.getTime(); } Date createdBefore = query.createdBefore(); long endTime = createdBefore == null ? system.now() : createdBefore.getTime(); Duration timeSpan = new Duration(startTime, endTime); DateHistogramInterval bucketSize = DateHistogramInterval.YEAR; if (timeSpan.isShorterThan(TWENTY_DAYS)) { bucketSize = DateHistogramInterval.DAY; } else if (timeSpan.isShorterThan(TWENTY_WEEKS)) { bucketSize = DateHistogramInterval.WEEK; } else if (timeSpan.isShorterThan(TWENTY_MONTHS)) { bucketSize = DateHistogramInterval.MONTH; } AggregationBuilder dateHistogram = AggregationBuilders.dateHistogram(PARAM_CREATED_AT) .field(IssueIndexDefinition.FIELD_ISSUE_FUNC_CREATED_AT) .dateHistogramInterval(bucketSize) .minDocCount(0L) .format(JODA_DATE_TIME_FORMAT) .timeZone(DateTimeZone.forOffsetMillis(system.getDefaultTimeZone().getRawOffset())) .extendedBounds(new ExtendedBounds(startTime, endTime - 1L)); addEffortAggregationIfNeeded(query, dateHistogram); return Optional.of(dateHistogram); }
Source:
public static void beforeClass() throws Exception { if (bot.activeView().getTitle().equals("Welcome")) bot.viewByTitle("Welcome").close(); bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate(); bot.viewByTitle("Package Explorer").show(); bot.menu("File").menu("New").menu("Java Project").click(); SWTBotShell shell = bot.shell("New Java Project"); shell.activate(); bot.textWithLabel("Project name:").setText(projectName); bot.button("Finish").click(); }

Target:
public static void beforeClass() throws Exception { if (bot.activeView().getTitle().equals("Welcome")) bot.viewByTitle("Welcome").close(); bot.perspectiveById("org.eclipse.jdt.ui.JavaPerspective").activate(); bot.viewByTitle("Package Explorer").show(); bot.menu("File").menu("New").menu("Project...").click(); bot.tree().getTreeItem("General").expand().getNode("Project").select(); bot.button("Next >").click(); bot.textWithLabel("Project name:").setText(projectName); bot.button("Finish").click(); }
Source:
public void testHardTimeExpiration() throws InterruptedException { org.midonet.odp.FlowMatch flowMatch = new org.midonet.odp.FlowMatch().addKey(FlowKeys.tunnel(10L, 100, 200)); WildcardFlow wildcardFlow = WildcardFlowFactory.createHardExpiration(flowMatch, timeOut); Flow flow = new Flow(flowMatch, actionsAsJava(wildcardFlow)); int numberOfFlowsAdded = 0; ManagedWildcardFlow wflow = ManagedWildcardFlow.create(wildcardFlow); flowManager.add(wflow); flowManager.add(flow, wflow); flowManagerHelper.addFlow(new Flow(flowMatch)); numberOfFlowsAdded++; assertThat("DpFlowTable was not updated", flowManager.dpFlowTable.size(), equalTo(numberOfFlowsAdded)); assertThat("WildcardFlowsToDpFlows was not updated", flowManager.getNumWildcardFlows(), equalTo(numberOfFlowsAdded)); assertThat("DpFlowToWildFlow table was not updated", flowManager.getWildcardTables().get( wflow.getMatch().getUsedFields()) .get(wflow.getMatch()), equalTo(wflow)); Thread.sleep(timeOut); flowManager.checkFlowsExpiration(); assertThat("Flow was not deleted", flowManagerHelper.flowsMap.get(flowMatch), nullValue()); assertThat("Flow was not deleted from ManagedWildcardFlow", !wflow.dpFlows().contains(flowMatch)); }

Target:
public void testHardTimeExpiration() throws InterruptedException { FlowMatch flowMatch = new FlowMatch().addKey(FlowKeys.tunnel(10L, 100, 200)); WildcardFlow wildcardFlow = WildcardFlowFactory.createHardExpiration(flowMatch, timeOut); Flow flow = new Flow(flowMatch, actionsAsJava(wildcardFlow)); int numberOfFlowsAdded = 0; ManagedWildcardFlow wflow = ManagedWildcardFlow.create(wildcardFlow); flowManager.add(wflow); flowManager.add(flow, wflow); flowManagerHelper.addFlow(new Flow(flowMatch)); numberOfFlowsAdded++; assertThat("DpFlowTable was not updated", flowManager.dpFlowTable.size(), equalTo(numberOfFlowsAdded)); assertThat("WildcardFlowsToDpFlows was not updated", flowManager.getNumWildcardFlows(), equalTo(numberOfFlowsAdded)); assertThat("DpFlowToWildFlow table was not updated", flowManager.getWildcardTables().get( wflow.getMatch().getUsedFields()) .get(wflow.getMatch()), equalTo(wflow)); Thread.sleep(timeOut); flowManager.checkFlowsExpiration(); assertThat("Flow was not deleted", flowManagerHelper.flowsMap.get(flowMatch), nullValue()); assertThat("Flow was not deleted from ManagedWildcardFlow", !wflow.dpFlows().contains(flowMatch)); }
Source:
protected abstract void runAutonomous() throws InterruptedException, AutonomousModeOverException; public void loadSettings(TuningContext context) { this.driveSpeed = context.getFloat("auto-main-driveSpeed", 1.0f); this.rotateSpeed = context.getFloat("auto-main-rotateSpeed", 1.0f); this.clampHeightPadding = context.getFloat("auto-main-clampHeightPadding", 0.1f); }

Target:
protected abstract void runAutonomous() throws InterruptedException, AutonomousModeOverException; public void loadSettings(TuningContext context) { this.driveSpeed = context.getFloat("auto-main-driveSpeed", 1.0f); this.rotateSpeed = context.getFloat("auto-main-rotateSpeed", 1.0f); this.clampHeightPadding = context.getFloat("auto-main-clampHeightPadding", 0.01f); }
Source:
public void loadConfiguration(IProgressMonitor monitor) { if (!configured) { synchronized (this) { if (!configured) { try { mapping = Collections.emptyMap(); if (source != null) { File file = new File(source); if (file.isFile()) { Map<String, String> result; if (kind == ESourceKind.BINARY) { result = FunctionNameMapper.mapFromBinaryFile(file); } else { result = FunctionNameMapper.mapFromNmTextFile(file); } if (result != null) { mapping = result; } } } } finally { configured = true; } } } } }

Target:
public void loadConfiguration(IProgressMonitor monitor) { if (!fConfigured) { synchronized (this) { if (!fConfigured) { try { fMapping = Collections.emptyMap(); if (fSource != null) { File file = new File(fSource); if (file.isFile()) { Map<String, String> result; if (fKind == SourceKind.BINARY) { result = FunctionNameMapper.mapFromBinaryFile(file); } else { result = FunctionNameMapper.mapFromNmTextFile(file); } if (result != null) { fMapping = result; } } } } finally { fConfigured = true; } } } } }
Source:
public void onSelectPage(@NonNull Card card, @NonNull HistoryEntry entry, View view) { ActivityOptionsCompat options = ActivityOptionsCompat. makeSceneTransitionAnimation((Activity) getContext(), ((ListCardItemView) view).getTitleView(), getContext().getString(R.string.transition_title)); startActivity(PageActivity.newIntentForNewTab(getContext(), entry, entry.getTitle()), options.toBundle()); }

Target:
public void onSelectPage(@NonNull Card card, @NonNull HistoryEntry entry, View view) { ActivityOptionsCompat options = ActivityOptionsCompat. makeSceneTransitionAnimation(getAppCompatActivity(), ((ListCardItemView) view).getTitleView(), getContext().getString(R.string.transition_title)); startActivity(PageActivity.newIntentForNewTab(getContext(), entry, entry.getTitle()), options.toBundle()); }
Source:
private static void setSuspensionLevel(int level) { if (level < 0 || level >= valves.length) { throw new IndexOutOfBoundsException(); } for (int i = 0; i < valves.length; i++) { if (i == level) { valves[i].set(true); } else { valves[i].set(false); } } currentLevel = level; }

Target:
private static void setSuspensionLevel(int level) { if (level < 0 || level >= valves.length) { throw new IndexOutOfBoundsException(); } for (int i = 0; i < valves.length; i++) { valves[i].set(i == level); } currentLevel = level; }
Source:
public void deletePrefix(WinePrefixDTO winePrefix, Consumer<Exception> errorCallback) { try { fileUtilities.remove(new File(winePrefix.getPath())); } catch (IOException e) { errorCallback.accept(e); } List<ShortcutDTO> shortcuts = libraryManager.fetchShortcuts(); for (ShortcutDTO shortcutDTO: shortcuts) { final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession(); interactiveScriptSession.eval("include([\"Functions\", \"Shortcuts\", \"Reader\"]);", ignored -> interactiveScriptSession.eval( "new ShortcutReader()", output -> { final ScriptObjectMirror shortcutReader = (ScriptObjectMirror) output; shortcutReader.callMember("of", shortcutDTO); final String container = (String) shortcutReader.callMember("container"); if (container.equals(winePrefix.getName())) { shortcutManager.deleteShortcut(shortcutDTO); } }, errorCallback), errorCallback ); } }

Target:
public void deletePrefix(WinePrefixDTO winePrefix, Consumer<Exception> errorCallback) { try { fileUtilities.remove(new File(winePrefix.getPath())); } catch (IOException e) { LOGGER.error("Cannot delete Wine prefix (" + winePrefix.getPath() + ")! Exception: " + e.toString()); errorCallback.accept(e); } List<ShortcutDTO> shortcuts = libraryManager.fetchShortcuts(); for (ShortcutDTO shortcutDTO: shortcuts) { final InteractiveScriptSession interactiveScriptSession = scriptInterpreter.createInteractiveSession(); interactiveScriptSession.eval("include([\"Functions\", \"Shortcuts\", \"Reader\"]);", ignored -> interactiveScriptSession.eval( "new ShortcutReader()", output -> { final ScriptObjectMirror shortcutReader = (ScriptObjectMirror) output; shortcutReader.callMember("of", shortcutDTO); final String container = (String) shortcutReader.callMember("container"); if (container.equals(winePrefix.getName())) { shortcutManager.deleteShortcut(shortcutDTO); } }, errorCallback), errorCallback ); } }
Source:
public final Optional<RedirectAction> getLogoutAction(final WebContext context, final U currentProfile, final String targetUrl) { init(); return Optional.of(logoutActionBuilder.getLogoutAction(context, currentProfile, targetUrl)); }

Target:
public final Optional<RedirectAction> getLogoutAction(final WebContext context, final U currentProfile, final String targetUrl) { init(); return logoutActionBuilder.getLogoutAction(context, currentProfile, targetUrl); }
Source:
public void processLeftCheckpoint(final MistCheckpointEvent input) { final Map<String, Object> stateMap = checkpointMap.remove(latestTimestampBeforeCheckpoint); stateMap.put("count", count); checkpointMap.put(latestTimestampBeforeCheckpoint, stateMap); outputEmitter.emitCheckpoint(input); }

Target:
public void processLeftCheckpoint(final MistCheckpointEvent input) { final Map<String, Object> stateMap = super.getStateSnapshot(); stateMap.put("count", count); checkpointMap.put(latestTimestampBeforeCheckpoint, stateMap); outputEmitter.emitCheckpoint(input); }
Source:
public Map<String, Optional<Partition>> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) { if (partitionNames.isEmpty()) { return Collections.emptyMap(); } try { List<PartitionInfo> partitionInfos = ProtoUtils.toPartitionInfoList( client.readTable(databaseName, tableName, Constraint.getDefaultInstance())); partitionInfos = partitionInfos.stream().filter(p -> p.getTableName().equals(tableName)) .collect(Collectors.toList()); Map<String, Optional<Partition>> result = partitionInfos.stream() .filter(p -> partitionNames.stream().anyMatch(p.getPartitionName()::equals)) .collect(Collectors.toMap( PartitionInfo::getPartitionName, pi -> Optional.of(ProtoUtils.fromProto(pi)))); return Collections.unmodifiableMap(result); } catch (AlluxioStatusException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }

Target:
public Map<String, Optional<Partition>> getPartitionsByNames(String databaseName, String tableName, List<String> partitionNames) { if (partitionNames.isEmpty()) { return ImmutableMap.of(); } try { List<PartitionInfo> partitionInfos = AlluxioProtoUtils.toPartitionInfoList(client.readTable(databaseName, tableName, Constraint.getDefaultInstance())); partitionInfos = partitionInfos.stream().filter(p -> p.getTableName().equals(tableName)).collect(toImmutableList()); return partitionInfos.stream() .filter(p -> partitionNames.stream().anyMatch(p.getPartitionName()::equals)) .collect(toImmutableMap(PartitionInfo::getPartitionName, partitionInfo -> Optional.of(AlluxioProtoUtils.fromProto(partitionInfo)))); } catch (AlluxioStatusException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } }
Source:
public void setWidth(int desiredWidth, int desiredScale, boolean errorOnTrunc) throws StandardException { int sourceWidth; if ( (_clobValue == null ) && (getString() == null) ) { return; } sourceWidth = getLength(); if (sourceWidth < desiredWidth) { if (!(this instanceof SQLVarchar)) { StringBuilder strBuilder; strBuilder = new StringBuilder(getString()); for ( ; sourceWidth < desiredWidth-1; sourceWidth++) { strBuilder.append(' '); } setValue(new String(strBuilder)); } } else if (sourceWidth > desiredWidth && desiredWidth > 0) { try { hasNonBlankChars(getString(), desiredWidth, sourceWidth); } catch (StandardException se) { if (errorOnTrunc) { throw se; } String source = getString(); int transferSize = getUTF8Length(source, 0, desiredWidth); int dataSize = transferSize + getUTF8Length(source, desiredWidth, source.length()); DataTruncation warning = new DataTruncation( -1, false, true, dataSize, transferSize, se); StatementContext statementContext = (StatementContext) ContextService.getContext(ContextId.LANG_STATEMENT); if (statementContext != null) { Activation activation = statementContext.getActivation(); if (activation != null) { activation.getResultSet().addWarning(warning); } } String warningMessage = String.format("Truncated a string source=%s, sourceWidth=%s, desiredWidth=%s", source, sourceWidth, desiredWidth); logger.warn(warningMessage); } setValue(getString().substring(0, desiredWidth)); } }

Target:
public void setWidth(int desiredWidth, int desiredScale, boolean errorOnTrunc) throws StandardException { int sourceWidth; if ( (_clobValue == null ) && (getString() == null) ) { return; } sourceWidth = getLength(); if (sourceWidth < desiredWidth) { if (!(this instanceof SQLVarchar)) { StringBuilder strBuilder; strBuilder = new StringBuilder(getString()); for ( ; sourceWidth < desiredWidth-1; sourceWidth++) { strBuilder.append(' '); } setValue(new String(strBuilder)); } } else if (sourceWidth > desiredWidth && desiredWidth > 0) { try { hasNonBlankChars(getString(), desiredWidth, sourceWidth); } catch (StandardException se) { if (errorOnTrunc) { throw se; } String source = getString(); int transferSize = getUTF8Length(source, 0, desiredWidth); int dataSize = transferSize + getUTF8Length(source, desiredWidth, source.length()); DataTruncation warning = new DataTruncation( -1, false, true, dataSize, transferSize, se); StatementContext statementContext = (StatementContext) ContextService.getContext(ContextId.LANG_STATEMENT); if (statementContext != null) { Activation activation = statementContext.getActivation(); if (activation != null) { activation.getResultSet().addWarning(warning); } } String warningMessage = String.format("Truncated a string source=%s, sourceWidth=%d, desiredWidth=%d", source, sourceWidth, desiredWidth); logger.warn(warningMessage); } setValue(getString().substring(0, desiredWidth)); } }
Source:
public void onApplicationEvent(ContextStartedEvent event) { CronTasksConfigurationDto cronTasksConfiguration = getTasksConfigurationDto(); for (CronTaskConfigurationDto dto : cronTasksConfiguration.getCronTaskConfigurations()) { if (dto.isOneTimeExecution()) { continue; } cronJobSchedulerService.scheduleJob(dto); if (dto.shouldExecuteImmediately()) { cronJobSchedulerService.executeJob(dto); } } }

Target:
public void onApplicationEvent(ContextStartedEvent event) { CronTasksConfigurationDto cronTasksConfiguration = getTasksConfigurationDto(); for (CronTaskConfigurationDto dto : cronTasksConfiguration.getCronTaskConfigurations()) { if (dto.isOneTimeExecution()) { continue; } cronJobSchedulerService.scheduleJob(dto); } }
Source:
public static boolean updateDiskStats(HWDiskStore diskStore) { String index = null; HWPartition[] partitions = diskStore.getPartitions(); if (partitions.length > 0) { index = Integer.toString(partitions[0].getMajor()); } else if (diskStore.getName().startsWith(PHYSICALDRIVE_PREFIX)) { index = diskStore.getName().substring(PHYSICALDRIVE_PREFIX.length(), diskStore.getName().length()); } else { LOG.warn("Couldn't match index for {}", diskStore.getName()); return false; } populateReadWriteMaps(index); if (readMap.containsKey(index)) { diskStore.setReads(MapUtil.getOrDefault(readMap, index, 0L)); diskStore.setReadBytes(MapUtil.getOrDefault(readByteMap, index, 0L)); diskStore.setWrites(MapUtil.getOrDefault(writeMap, index, 0L)); diskStore.setWriteBytes(MapUtil.getOrDefault(writeByteMap, index, 0L)); diskStore.setCurrentQueueLength(MapUtil.getOrDefault(queueLengthMap, index, 0L)); diskStore.setTransferTime(MapUtil.getOrDefault(timeStampMap, index, 0L)-MapUtil.getOrDefault(xferTimeMap, index, 0L)); diskStore.setTimeStamp(MapUtil.getOrDefault(timeStampMap, index, 0L)); return true; } else { return false; } }

Target:
public static boolean updateDiskStats(HWDiskStore diskStore) { String index = null; HWPartition[] partitions = diskStore.getPartitions(); if (partitions.length > 0) { index = Integer.toString(partitions[0].getMajor()); } else if (diskStore.getName().startsWith(PHYSICALDRIVE_PREFIX)) { index = diskStore.getName().substring(PHYSICALDRIVE_PREFIX.length(), diskStore.getName().length()); } else { LOG.warn("Couldn't match index for {}", diskStore.getName()); return false; } populateReadWriteMaps(index); if (readMap.containsKey(index)) { diskStore.setReads(MapUtil.getOrDefault(readMap, index, 0L)); diskStore.setReadBytes(MapUtil.getOrDefault(readByteMap, index, 0L)); diskStore.setWrites(MapUtil.getOrDefault(writeMap, index, 0L)); diskStore.setWriteBytes(MapUtil.getOrDefault(writeByteMap, index, 0L)); diskStore.setCurrentQueueLength(MapUtil.getOrDefault(queueLengthMap, index, 0L)); diskStore.setTimeStamp(MapUtil.getOrDefault(timeStampMap, index, 0L)); diskStore.setTransferTime(diskStore.getTimeStamp()-MapUtil.getOrDefault(xferTimeMap, index, 0L)); return true; } else { return false; } }
Source:
public GatewayRefundResponse refund(RefundGatewayRequest request) { EpdqRefundResponse unmarshalled; try { GatewayClient.Response response = client.postRequestFor(ROUTE_FOR_MAINTENANCE_ORDER, request.getGatewayAccount(), buildRefundOrder(request)); unmarshalled = unmarshallResponse(response, EpdqRefundResponse.class); } catch (GenericGatewayErrorException | GatewayConnectionTimeoutErrorException | GatewayConnectionErrorException e) { return GatewayRefundResponse.fromGatewayError(e.toGatewayError()); } return GatewayRefundResponse.fromBaseRefundResponse(unmarshalled, PENDING); }

Target:
public GatewayRefundResponse refund(RefundGatewayRequest request) { try { GatewayClient.Response response = client.postRequestFor(ROUTE_FOR_MAINTENANCE_ORDER, request.getGatewayAccount(), buildRefundOrder(request)); return GatewayRefundResponse.fromBaseRefundResponse(unmarshallResponse(response, EpdqRefundResponse.class), PENDING); } catch (GenericGatewayErrorException | GatewayConnectionTimeoutErrorException | GatewayConnectionErrorException e) { return GatewayRefundResponse.fromGatewayError(e.toGatewayError()); } }
Source:
public List<LogrotateAdditionalFile> getExtrasFilesHourly() { return getAllExtraFiles().stream() .filter(p -> p.getLogrotateFrequencyOverride().equals(SingularityExecutorLogrotateFrequency.HOURLY)).collect(Collectors.toList()); }

Target:
public List<LogrotateAdditionalFile> getExtrasFilesHourly() { return getAllExtraFiles().stream() .filter(p -> p.getLogrotateFrequencyOverride().equals(SingularityExecutorLogrotateFrequency.HOURLY.getLogrotateValue())) .collect(Collectors.toList()); }
Source:
public static String extractKFSInfoFromConcurString(String concurString) { String kfsInfo = StringUtils.EMPTY; if (StringUtils.isNotBlank(concurString) && concurString.contains(CUKFSConstants.LEFT_PARENTHESIS) && concurString.contains(CUKFSConstants.RIGHT_PARENTHESIS) && concurString.lastIndexOf(CUKFSConstants.LEFT_PARENTHESIS) < concurString.length()) { kfsInfo = concurString.substring(concurString.lastIndexOf(CUKFSConstants.LEFT_PARENTHESIS) + 1, concurString.lastIndexOf(CUKFSConstants.RIGHT_PARENTHESIS)); } return kfsInfo; }

Target:
public static String extractKFSInfoFromConcurString(String concurString) { String kfsInfo = StringUtils.EMPTY; if (doesStringContainOpenCloseParenthesis(concurString)) { kfsInfo = concurString.substring(concurString.lastIndexOf(CUKFSConstants.LEFT_PARENTHESIS) + 1, concurString.lastIndexOf(CUKFSConstants.RIGHT_PARENTHESIS)); } return kfsInfo; }
Source:
private void unmarkTeamPrivate(final IContainer p) throws CoreException { final IResource[] c; c = p.members(IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS); if (c != null) { for (int k = 0; k < c.length; k++) { if (c[k] instanceof IContainer) { unmarkTeamPrivate((IContainer) c[k]); } if (c[k].isTeamPrivateMember()) { if (GitTraceLocation.CORE.isActive()) { GitTraceLocation.getTrace().trace( GitTraceLocation.CORE.getLocation(), "notTeamPrivate " + c[k]); } c[k].setTeamPrivateMember(false); } } } }

Target:
private void unmarkTeamPrivate(final IContainer p) throws CoreException { final IResource[] c; c = p.members(IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS); if (c != null) { for (int k = 0; k < c.length; k++) { if (c[k] instanceof IContainer) { unmarkTeamPrivate((IContainer) c[k]); } if (c[k].isTeamPrivateMember()) { if (GitTraceLocation.CORE.isActive()) GitTraceLocation.getTrace().trace( GitTraceLocation.CORE.getLocation(), "notTeamPrivate " + c[k]); c[k].setTeamPrivateMember(false); } } } }
Source:
public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = CamoManager.getPlayerCamoImage(player); if (entity.getCamoCategory() != null && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { camo = CamoManager.getEntityCamoImage(entity); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); Image icon = bv.getTilesetManager().loadPreviewImage(entity, camo, tint, bp); if (icon != null) { bp.setIcon(new ImageIcon(icon)); } else { bp.setIcon(null); } }

Target:
public void loadPreviewImage(JLabel bp, Entity entity, IPlayer player) { Image camo = CamoManager.getPlayerCamoImage(player); if ((entity.getCamoCategory() != null) && !entity.getCamoCategory().equals(IPlayer.NO_CAMO)) { camo = CamoManager.getEntityCamoImage(entity); } int tint = PlayerColors.getColorRGB(player.getColorIndex()); Image icon = bv.getTilesetManager().loadPreviewImage(entity, camo, tint, bp); if (icon != null) { bp.setIcon(new ImageIcon(icon)); } else { bp.setIcon(null); } }
Source:
protected static void validateUpsertConfig(TableConfig tableConfig, Schema schema) { if (tableConfig.getUpsertMode() == UpsertConfig.Mode.NONE) { return; } Preconditions .checkState(tableConfig.getTableType() == TableType.REALTIME, "Upsert table is for realtime table only."); Preconditions.checkState(CollectionUtils.isNotEmpty(schema.getPrimaryKeyColumns()), "Upsert table must have primary key columns in the schema"); Preconditions.checkState( tableConfig.getIndexingConfig() != null && tableConfig.getIndexingConfig().getStreamConfigs() != null, "streamConfig must exist in the table config"); StreamConfig streamConfig = new StreamConfig(tableConfig.getTableName(), tableConfig.getIndexingConfig().getStreamConfigs()); Preconditions.checkState(streamConfig.hasLowLevelConsumerType() && !streamConfig.hasHighLevelConsumerType(), "Upsert table must use low-level streaming consumer type"); Preconditions.checkState( tableConfig.getRoutingConfig() != null && RoutingConfig.REPLICA_GROUP_INSTANCE_SELECTOR_TYPE .equalsIgnoreCase(tableConfig.getRoutingConfig().getInstanceSelectorType()), "Upsert table must use replica-group (i.e. replicaGroup) based routing"); Preconditions.checkState( tableConfig.getIndexingConfig().getStarTreeIndexConfigs() == null || tableConfig.getIndexingConfig() .getStarTreeIndexConfigs().isEmpty(), "The upsert table cannot have star-tree index."); }

Target:
protected static void validateUpsertConfig(TableConfig tableConfig, Schema schema) { if (tableConfig.getUpsertMode() == UpsertConfig.Mode.NONE) { return; } Preconditions .checkState(tableConfig.getTableType() == TableType.REALTIME, "Upsert table is for realtime table only."); Preconditions.checkState(CollectionUtils.isNotEmpty(schema.getPrimaryKeyColumns()), "Upsert table must have primary key columns in the schema"); Preconditions.checkState( tableConfig.getIndexingConfig() != null && tableConfig.getIndexingConfig().getStreamConfigs() != null, "streamConfig must exist in the table config"); StreamConfig streamConfig = new StreamConfig(tableConfig.getTableName(), tableConfig.getIndexingConfig().getStreamConfigs()); Preconditions.checkState(streamConfig.hasLowLevelConsumerType() && !streamConfig.hasHighLevelConsumerType(), "Upsert table must use low-level streaming consumer type"); Preconditions.checkState( tableConfig.getRoutingConfig() != null && RoutingConfig.REPLICA_GROUP_INSTANCE_SELECTOR_TYPE .equalsIgnoreCase(tableConfig.getRoutingConfig().getInstanceSelectorType()), "Upsert table must use replica-group (i.e. replicaGroup) based routing"); Preconditions.checkState( CollectionUtils.isEmpty(tableConfig.getIndexingConfig().getStarTreeIndexConfigs()) && !tableConfig .getIndexingConfig().isEnableDefaultStarTree(), "The upsert table cannot have star-tree index."); }
Source:
public void createObjectWithUserMetadata() throws Exception { Form form = new Form().param("name", bucketName); Response response = target("/buckets").request(MediaType.APPLICATION_JSON_TYPE).post(Entity.form(form)); assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); response = target("/objects").request() .post(Entity.entity(new FormDataMultiPart() .field("bucketName", bucketName).field("create", "new") .field("key", "object1").field("contentType", "text/plain") .field("timestamp", "2012-09-08 11:00:00") .field("userMetadata", VALID_USER_METADATA) .field("file", testData1, MediaType.TEXT_PLAIN_TYPE), MediaType.MULTIPART_FORM_DATA )); assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); response = target("/objects/meta/" + bucketName).queryParam("key", "object1") .request(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .get(); JsonObject responseObj = gson.fromJson(response.readEntity(String.class), JsonElement.class).getAsJsonObject(); assertNotNull(responseObj); assertEquals(VALID_USER_METADATA, responseObj.get("userMetadata").toString()); }

Target:
public void createObjectWithUserMetadata() throws Exception { Form form = new Form().param("name", bucketName); Response response = target("/buckets").request(MediaType.APPLICATION_JSON_TYPE).post(Entity.form(form)); assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); response = target("/objects").request() .post(Entity.entity(new FormDataMultiPart() .field("bucketName", bucketName).field("create", "new") .field("key", "object1").field("contentType", "text/plain") .field("timestamp", "2012-09-08 11:00:00") .field("userMetadata", USER_METADATA) .field("file", testData1, MediaType.TEXT_PLAIN_TYPE), MediaType.MULTIPART_FORM_DATA )); assertEquals(response.getStatus(), Response.Status.CREATED.getStatusCode()); response = target("/objects/meta/" + bucketName).queryParam("key", "object1") .request(MediaType.APPLICATION_JSON_TYPE) .accept(MediaType.APPLICATION_JSON_TYPE) .get(); JsonObject responseObj = gson.fromJson(response.readEntity(String.class), JsonElement.class).getAsJsonObject(); assertNotNull(responseObj); assertEquals(USER_METADATA, responseObj.get("userMetadata").getAsString()); }
Source:
private static String fetchPrometheusUrl(Provider<KubevirtProviderProperties> provider) { OpenshiftApi api; Optional<V1Route> route = null; try { api = KubevirtUtils.getOpenshiftApi(provider); } catch (IOException e) { log.error("failed to connect to openshift for kubevirt provider (url = {}): {}", provider.getUrl(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); return null; } try { V1RouteList routes = api.listNamespacedRoute("openshift-monitoring", null, "metadata.name=prometheus-k8s", null, null, null, null, null, Boolean.FALSE); route = routes.getItems().stream().findAny(); } catch (ApiException e) { log.error("failed to retrieve prometheus url for kubevirt provider (url = {}): {}", provider.getUrl(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); } if (route != null && route.isPresent()) { String host = route.get().getSpec().getHost(); try { return new URI("https", host, null, null).toString(); } catch (URISyntaxException e) { log.error("failed to retrieve prometheus url for kubevirt provider (url = {}): {}", provider.getUrl(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); } } return null; }

Target:
private static String fetchPrometheusUrl(Provider<KubevirtProviderProperties> provider) { OpenshiftApi api; Optional<V1Route> route = null; try { api = KubevirtUtils.getOpenshiftApi(provider); } catch (IOException e) { log.error("failed to connect to openshift for kubevirt provider (url = {}): {}", provider.getUrl(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); return null; } try { V1RouteList routes = api.listNamespacedRoute("openshift-monitoring", null, "metadata.name=prometheus-k8s", null, null, null, null, null, Boolean.FALSE); route = routes.getItems().stream().findAny(); } catch (ApiException e) { log.error("failed to retrieve prometheus url for kubevirt provider (url = {}): {}", provider.getUrl(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); } if (route != null && route.isPresent()) { String host = route.get().getSpec().getHost(); try { return new URI("https", host, null, null).toString(); } catch (URISyntaxException e) { log.error("Failed to retrieve prometheus url for kubevirt provider (host = {}, url = {}): {}", host, provider.getUrl(), ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception", e); } } return null; }
Source:
private TopologyActions getTopologyActionsImpl () { String className = (String) config.get("topologyActionsImpl"); String jar = (String) config.get("iotasStormJar"); TopologyActions topologyActions; try { topologyActions = ReflectionHelper.newInstance(className); } catch (Exception ex) { throw new RuntimeException(ex); } Map<String, String> conf = new HashMap<>(); conf.put(StormTopologyLayoutConstants.STORM_JAR_LOCATION_KEY, jar); conf.put(StormTopologyLayoutConstants.YAML_KEY_CATALOG_ROOT_URL, (String) config.get("catalogRootUrl")); conf.put(StormTopologyLayoutConstants.STORM_HOME_DIR, (String) config.get("stormHomeDir")); conf.put(TopologyLayoutConstants.JAVA_JAR_COMMAND, (String) config.get("javaJarCommand")); topologyActions.init(conf); return topologyActions; }

Target:
private TopologyActions getTopologyActionsImpl () { String className = (String) config.get(com.hortonworks.iotas.streams.common.Constants.CONFIG_TOPOLOGY_ACTIONS_IMPL); String jar = (String) config.get(StormTopologyLayoutConstants.STORM_JAR_LOCATION_KEY); TopologyActions topologyActions; try { topologyActions = ReflectionHelper.newInstance(className); } catch (Exception ex) { throw new RuntimeException(ex); } Map<String, String> conf = new HashMap<>(); conf.put(StormTopologyLayoutConstants.STORM_JAR_LOCATION_KEY, jar); conf.put(StormTopologyLayoutConstants.YAML_KEY_CATALOG_ROOT_URL, (String) config.get(Constants.CONFIG_CATALOG_ROOT_URL)); conf.put(StormTopologyLayoutConstants.STORM_HOME_DIR, (String) config.get(StormTopologyLayoutConstants.STORM_HOME_DIR)); conf.put(TopologyLayoutConstants.JAVA_JAR_COMMAND, (String) config.get(TopologyLayoutConstants.JAVA_JAR_COMMAND)); topologyActions.init(conf); return topologyActions; }
Source:
public Builder toBuilder() { return new Builder<Builder<?>>().setConfiguration(configuration); }

Target:
public Builder toBuilder() { return new Builder(getConfiguration()); }
Source:
private boolean registerNewHost(Guid vdsGroupId, boolean IsPending) { boolean returnValue = true; VdsStatic vds = new VdsStatic(getParameters().getVdsHostName(), "", getStrippedVdsUniqueId(), getParameters().getPort(), vdsGroupId, Guid.Empty, getParameters().getVdsName(), Config.<Boolean> GetValue(ConfigValues.SSLEnabled), getParameters().getVdsType(), "N/A", "N/A", "N/A", "N/A", "N/A", "N/A"); log.debugFormat( "RegisterVdsQuery::Register - Will try now to add VDS from scratch; Name: {0}, Hostname: {1}, Unique: {2}, Port: {3},Subnet mask: {4}, IsPending: {5} with force synchronize", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId(), getParameters().getPort(), IsPending); AddVdsActionParameters p = new AddVdsActionParameters(vds, ""); p.setAddPending(IsPending); VdcReturnValueBase ret = Backend.getInstance().runInternalAction(VdcActionType.AddVds, p); if (ret == null || !ret.getSucceeded()) { log.errorFormat( "RegisterVdsQuery::Register - Registration failed for VDS - Name: {0}, Hostname: {1}, UniqueID: {2}, Subnet mask: {3}", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId()); CaptureCommandErrorsToLogger(ret, "RegisterVdsQuery::Register"); error = AuditLogType.VDS_REGISTER_FAILED; returnValue = false; } else { log.infoFormat( "RegisterVdsQuery::Register - Registered a new VDS {3} - Name: {0}, Hostname: {1}, UniqueID: {2}", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId(), IsPending ? "pending approval" : "automatically approved"); } return returnValue; }

Target:
private boolean registerNewHost(Guid vdsGroupId, boolean IsPending) { boolean returnValue = true; VdsStatic vds = new VdsStatic(getParameters().getVdsHostName(), "", getStrippedVdsUniqueId(), getParameters().getPort(), vdsGroupId, Guid.Empty, getParameters().getVdsName(), Config.<Boolean> GetValue(ConfigValues.SSLEnabled), getParameters().getVdsType(), "", "", "", "", "", ""); log.debugFormat( "RegisterVdsQuery::Register - Will try now to add VDS from scratch; Name: {0}, Hostname: {1}, Unique: {2}, Port: {3},Subnet mask: {4}, IsPending: {5} with force synchronize", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId(), getParameters().getPort(), IsPending); AddVdsActionParameters p = new AddVdsActionParameters(vds, ""); p.setAddPending(IsPending); VdcReturnValueBase ret = Backend.getInstance().runInternalAction(VdcActionType.AddVds, p); if (ret == null || !ret.getSucceeded()) { log.errorFormat( "RegisterVdsQuery::Register - Registration failed for VDS - Name: {0}, Hostname: {1}, UniqueID: {2}, Subnet mask: {3}", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId()); CaptureCommandErrorsToLogger(ret, "RegisterVdsQuery::Register"); error = AuditLogType.VDS_REGISTER_FAILED; returnValue = false; } else { log.infoFormat( "RegisterVdsQuery::Register - Registered a new VDS {3} - Name: {0}, Hostname: {1}, UniqueID: {2}", getParameters().getVdsName(), getParameters().getVdsHostName(), getStrippedVdsUniqueId(), IsPending ? "pending approval" : "automatically approved"); } return returnValue; }
Source:
public MetadataResource(SessionFactory sessionFactory, DockstoreWebserviceConfiguration config) { this.toolDAO = new ToolDAO(sessionFactory); this.workflowDAO = new WorkflowDAO(sessionFactory); this.organizationDAO = new OrganizationDAO(sessionFactory); this.collectionDAO = new CollectionDAO(sessionFactory); this.config = config; MetadataResourceHelper.setConfig(config); }

Target:
public MetadataResource(SessionFactory sessionFactory, DockstoreWebserviceConfiguration config) { this.toolDAO = new ToolDAO(sessionFactory); this.workflowDAO = new WorkflowDAO(sessionFactory); this.organizationDAO = new OrganizationDAO(sessionFactory); this.collectionDAO = new CollectionDAO(sessionFactory); this.config = config; }
Source:
public static <T> T callMethod(Object object, String methodName, Object... args) { Validate.notNull(object, "null class name"); Method method = null; boolean isAccessible = true; try { Class[] argTypes = new Class[args.length]; IntStream.range(0, args.length).forEach(i -> argTypes[i] = args[i].getClass()); method = object.getClass().getDeclaredMethod(methodName, argTypes); isAccessible = method.isAccessible(); method.setAccessible(true); return (T)method.invoke(object, args); } catch (Exception e) { LOG.warn("Failed to invoke method: " + methodName, e); return null; } finally { if (method != null) { method.setAccessible(isAccessible); } } }

Target:
public static <T> T callMethod(Object object, String methodName, Object... args) throws Exception { Validate.notNull(object, "null class name"); Method method = null; boolean isAccessible = true; try { Class[] argTypes = new Class[args.length]; IntStream.range(0, args.length).forEach(i -> argTypes[i] = args[i].getClass()); method = object.getClass().getDeclaredMethod(methodName, argTypes); isAccessible = method.isAccessible(); method.setAccessible(true); return (T)method.invoke(object, args); } catch (Exception e) { LOG.warn("Failed to invoke method: " + methodName, e); throw e; } finally { if (method != null) { method.setAccessible(isAccessible); } } }
Source:
protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (diskList == null || diskList.isEmpty()) { setReturnValue(Collections.emptyList()); return; } ArrayList<Disk> filteredDiskList = new ArrayList<Disk>(); VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { setReturnValue(Collections.emptyList()); return; } List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); HashSet<DiskInterface> supportedDiskInterfaces = new HashSet<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), e.toString()); } } for (Disk disk : diskList) { if (supportedDiskInterfaces.contains(disk.getDiskInterface())) { filteredDiskList.add(disk); } } setReturnValue(filteredDiskList); }

Target:
protected void executeQueryCommand() { List<Disk> diskList = DbFacade.getInstance() .getDiskDao() .getAllAttachableDisksByPoolId(getParameters().getStoragePoolId(), getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (CollectionUtils.isEmpty(diskList)) { setReturnValue(Collections.emptyList()); return; } VM vm = DbFacade.getInstance().getVmDao().get(getParameters().getVmId(), getUserID(), getParameters().isFiltered()); if (vm == null) { setReturnValue(Collections.emptyList()); return; } List<String> supportedDiskInterfaceNames = getOsRepository().getDiskInterfaces(vm.getOs(), vm.getVdsGroupCompatibilityVersion()); Collection<DiskInterface> supportedDiskInterfaces = new HashSet<DiskInterface>(); for (String interfaceName : supportedDiskInterfaceNames) { try { supportedDiskInterfaces.add(DiskInterface.valueOf(interfaceName)); } catch (IllegalArgumentException e) { LOG.errorFormat("Can't find the value {0} in the enum DiskInterface. Error: {1}", ((interfaceName == null) ? "null" : interfaceName), e.toString()); } } List<Disk> filteredDiskList = new ArrayList<Disk>(); for (Disk disk : diskList) { if (supportedDiskInterfaces.contains(disk.getDiskInterface())) { filteredDiskList.add(disk); } } setReturnValue(filteredDiskList); }
Source:
protected void onCreate(Bundle stateBundle) { super.onCreate(stateBundle); setContentView(R.layout.search_activity_main); queryHandler = new AsyncQueryHandler(getContentResolver()) {}; findViewById(R.id.search_activity_main).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.WAITING); } }); editText = (ClearableEditText) findViewById(R.id.search_edit_text); editText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.EDITING); } }); editText.setTextListener(new ClearableEditText.TextListener() { @Override public void onChange(String text) { if (editState == EditState.EDITING) { ((SuggestionsFragment) getSupportFragmentManager().findFragmentById(R.id.suggestions)) .loadSuggestions(text); } } @Override public void onSubmit(String text) { final String trimmedQuery = text.trim(); if (!TextUtils.isEmpty(trimmedQuery)) { onSearch(text); } } }); preSearch = findViewById(R.id.presearch); postSearch = findViewById(R.id.postsearch); suggestions = findViewById(R.id.suggestions); animationText = (TextView) findViewById(R.id.animation_text); animationCard = findViewById(R.id.animation_card); cardPaddingX = getResources().getDimensionPixelSize(R.dimen.card_background_padding_x); cardPaddingY = getResources().getDimensionPixelSize(R.dimen.card_background_padding_y); textEndY = getResources().getDimensionPixelSize(R.dimen.animation_text_translation_y); }

Target:
protected void onCreate(Bundle stateBundle) { super.onCreate(stateBundle); setContentView(R.layout.search_activity_main); queryHandler = new AsyncQueryHandler(getContentResolver()) {}; editText = (ClearableEditText) findViewById(R.id.search_edit_text); editText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.EDITING); } }); editText.setTextListener(new ClearableEditText.TextListener() { @Override public void onChange(String text) { if (editState == EditState.EDITING) { suggestionsFragment.loadSuggestions(text); } } @Override public void onSubmit(String text) { final String trimmedQuery = text.trim(); if (!TextUtils.isEmpty(trimmedQuery)) { onSearch(trimmedQuery); } } }); preSearch = findViewById(R.id.presearch); postSearch = findViewById(R.id.postsearch); suggestionsContainer = findViewById(R.id.suggestions_container); suggestionsFragment = (SuggestionsFragment) getSupportFragmentManager().findFragmentById(R.id.suggestions); findViewById(R.id.suggestions_container).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { setEditState(EditState.WAITING); } }); animationText = (TextView) findViewById(R.id.animation_text); animationCard = findViewById(R.id.animation_card); cardPaddingX = getResources().getDimensionPixelSize(R.dimen.card_background_padding_x); cardPaddingY = getResources().getDimensionPixelSize(R.dimen.card_background_padding_y); textEndY = getResources().getDimensionPixelSize(R.dimen.animation_text_translation_y); }
Source:
public void send(OteEventMessage message) { if(debug){ System.out.printf("[%s] sending: [%s] to [%s] [%d]\n", new Date(), message.getHeader().TOPIC.getValue(), address.toString(), message.getData().length); } message.getData(); AddressBuffer obj = buffers.getObject(); obj.getBuffer().clear(); obj.getBuffer().put(message.getData()); obj.getBuffer().flip(); obj.setAddress(address); try { toSend.put(obj); } catch (InterruptedException e) { throw new OTEException(e); } }

Target:
public void send(OteEventMessage message) { if(debug){ System.out.printf("[%s] sending: [%s] to [%s] [%d]\n", new Date(), message.getHeader().TOPIC.getValue(), address.toString(), message.getData().length); } AddressBuffer obj = buffers.getObject(); obj.getBuffer().clear(); obj.getBuffer().put(message.getData()); obj.getBuffer().flip(); obj.setAddress(address); try { toSend.put(obj); } catch (InterruptedException e) { throw new OTEException(e); } }