auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Member validateMemberAsync(final PerunSession sess, final Member member) throws InternalErrorException { new Thread(new Runnable() { public void run() { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } Status oldStatus = Status.getStatus(member.getStatus().getCode()); try { ((PerunSessionImpl) sess).getPerunBl().getMembersManagerBl().validateMember(sess, member); } catch(Exception ex) { log.info("validateMemberAsync failed. Cause: {}", ex); try { getPerunBl().getAuditer().log(sess, new MemberValidatedFailed(member, oldStatus)); log.info("Validation of failed. He stays in state.", member, oldStatus); } catch(RuntimeException internalError) { log.error("Store message to auditer failed. message: Validation of failed. He stays in state. cause: {}", new Object[] {member, oldStatus, internalError}); } } } }, "validateMemberAsync").start(); return member; }

Target:
public Member validateMemberAsync(final PerunSession sess, final Member member) throws InternalErrorException { new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(5000); } catch (InterruptedException e) { e.printStackTrace(); } Status oldStatus = Status.getStatus(member.getStatus().getCode()); try { ((PerunSessionImpl) sess).getPerunBl().getMembersManagerBl().validateMember(sess, member); } catch(Exception ex) { log.info("validateMemberAsync failed. Cause: {}", ex); getPerunBl().getAuditer().log(sess, new MemberValidatedFailed(member, oldStatus)); log.info("Validation of failed. He stays in state.", member, oldStatus); } } }, "validateMemberAsync").start(); return member; }
Source:
private static MessageBuffer newMessageBuffer(ByteBuffer bb) { checkNotNull(bb); try { return (MessageBuffer) mbBBConstructor.newInstance(bb); } catch (InstantiationException e) { throw new IllegalStateException(e); } catch (IllegalAccessException e) { throw new IllegalStateException(e); } catch (InvocationTargetException e) { if (e.getCause() instanceof RuntimeException) { throw (RuntimeException) e.getCause(); } else if (e.getCause() instanceof Error) { throw (Error) e.getCause(); } throw new IllegalStateException(e.getCause()); } }

Target:
private static MessageBuffer newMessageBuffer(ByteBuffer bb) { checkNotNull(bb); return newInstance(mbBBConstructor, bb); }
Source:
public String prettyString() { switch (subscriptionType) { case NONE: return "None"; case AUTO_TOPICS: return "Subscribe(" + String.join(",", subscription) + ")"; case AUTO_PATTERN: return "Subscribe(" + subscribedPattern + ")"; case USER_ASSIGNED: return "Assign(" + assignment.partitionStateValues() + " , id=" + assignmentId + ")"; default: throw new IllegalStateException("Un-recognized subscription type: " + subscriptionType); } }

Target:
public String prettyString() { switch (subscriptionType) { case NONE: return "None"; case AUTO_TOPICS: return "Subscribe(" + String.join(",", subscription) + ")"; case AUTO_PATTERN: return "Subscribe(" + subscribedPattern + ")"; case USER_ASSIGNED: return "Assign(" + assignedPartitions() + " , id=" + assignmentId + ")"; default: throw new IllegalStateException("Unrecognized subscription type: " + subscriptionType); } }
Source:
private Object formatTooltip(Long value, Object threshold, String data) { List<DataColumn> columns = dataSet.getColumns(); int size = columns.size(); DataColumn targetColumn; if (size == 1) { targetColumn = columns.get(0); } else if(size > 1) { targetColumn = columns.get(1); } else { return value; } String pattern = displayerSettings.getColumnSettings(targetColumn).getValuePattern(); return getFormatter().formatNumber(pattern, value); }

Target:
protected Object formatTooltip(Long value, Object threshold, String data) { List<DataColumn> columns = dataSet.getColumns(); int size = columns.size(); if (size == 1) { return formatValueForColumn(value, columns.get(0)); } if (size > 1) { return formatValueForColumn(value, columns.get(1)); } return value; }
Source:
public float getFontScaleFactor(Project project, BitmapFont font, GlyphLayout tempAxisLabelLayout) { tempAxisLabelLayout.setText(font, String.valueOf(project.getXmlHeader().virtualScreenWidth / 2)); float shortDisplaySide; if (project.getXmlHeader().islandscapeMode()) { shortDisplaySide = project.getXmlHeader().virtualScreenHeight; } else { shortDisplaySide = project.getXmlHeader().virtualScreenWidth; } return 0.025f * shortDisplaySide / tempAxisLabelLayout.height; }

Target:
public float getFontScaleFactor(Project project, BitmapFont font, GlyphLayout tempAxisLabelLayout) { tempAxisLabelLayout.setText(font, String.valueOf(project.getXmlHeader().virtualScreenWidth / 2)); float shortDisplaySide; if (project.getXmlHeader().islandscapeMode()) { shortDisplaySide = project.getXmlHeader().virtualScreenHeight; } else { shortDisplaySide = project.getXmlHeader().virtualScreenWidth; } return AXIS_FONT_SIZE_SCALE_FACTOR * shortDisplaySide / tempAxisLabelLayout.height; }
Source:
GenericCapability(ResolverBundle resolverBundle, GenericDescription base, boolean developmentMode) { super(base); this.resolverBundle = resolverBundle; String usesDirective = base.getDeclaredDirectives().get(Constants.USES_DIRECTIVE); uses = ManifestElement.getArrayFromList(usesDirective); String effectiveDirective = base.getDeclaredDirectives().get(Constants.EFFECTIVE_DIRECTIVE); effective = effectiveDirective == null || Constants.EFFECTIVE_RESOLVE.equals(effectiveDirective) || developmentMode; }

Target:
GenericCapability(ResolverBundle resolverBundle, GenericDescription base, boolean developmentMode) { super(base); this.resolverBundle = resolverBundle; String usesDirective = base.getDeclaredDirectives().get(Constants.USES_DIRECTIVE); uses = ManifestElement.getArrayFromList(usesDirective); String effectiveDirective = base.getDeclaredDirectives().get(Constants.EFFECTIVE_DIRECTIVE); effective = effectiveDirective == null || Constants.EFFECTIVE_RESOLVE.equals(effectiveDirective) || (Constants.EFFECTIVE_ACTIVE.equals(effectiveDirective) && developmentMode); }
Source:
public static synchronized void free(Vector3i v) { if (currentVector3isAvailable < POOL_SIZE) { VECTOR_3I_POOL[currentVector3isAvailable++] = v; } }

Target:
public static synchronized void free(Vector3i v) { freed3is++; if (currentVector3isAvailable < POOL_SIZE) { VECTOR_3I_POOL[currentVector3isAvailable++] = v; } }
Source:
public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException { log.trace("checkAttributeSemantics(resource={},group={},attribute={})", resource, group, attribute); List<String> emails = attribute.valueAsList(); if (emails == null) emails = new ArrayList<>(); for (String email : emails) { Matcher emailMatcher = emailPattern.matcher(email); if (!emailMatcher.matches()) throw new WrongAttributeValueException(attribute, resource, group, "Email " + email + " is not in correct form."); } if (hasDuplicate(emails)) { throw new WrongAttributeValueException(attribute, resource, group, "duplicate values"); } }

Target:
public void checkAttributeSyntax(PerunSessionImpl sess, Group group, Resource resource, Attribute attribute) throws InternalErrorException, WrongAttributeValueException { log.trace("checkAttributeSyntax(resource={},group={},attribute={})", resource, group, attribute); List<String> emails = attribute.valueAsList(); if (emails == null) return; for (String email : emails) { Matcher emailMatcher = emailPattern.matcher(email); if (!emailMatcher.matches()) throw new WrongAttributeValueException(attribute, resource, group, "Email " + email + " is not in correct form."); } if (hasDuplicate(emails)) { throw new WrongAttributeValueException(attribute, resource, group, "duplicate values"); } }
Source:
private User loadUser(Context context) { try { String userSessionJson = loadJsonString(context, USER_PATH); return gson.fromJson(userSessionJson, User.class); } catch(FileAccessException e) { return new User(); } }

Target:
private User loadUser(Context context) { try { String user = loadJsonString(context, USER_PATH); return gson.fromJson(user, User.class); } catch(FileAccessException e) { return null; } }
Source:
private void closeResources(final String fullPath, final int typeId, final int dataSetId, final int dataSpaceId) { final Optional<Throwable> closureError = Stream.of( closeType(typeId), closeDataSpace(dataSpaceId), closeDataset(dataSetId)) .filter(Objects::nonNull).findFirst(); if (closureError.isPresent()) { throw new GATKException( String.format("exception when closing string retrieval on data-set '%s' in file '%s'", fullPath, file), closureError.get()); } }

Target:
private void closeResources(final String fullPath, final int typeId, final int dataSetId, final int dataSpaceId) { final Optional<Exception> closureError = Stream.of( closeResource(() -> H5.H5Tclose(typeId)), closeResource(() -> H5.H5Sclose(dataSpaceId)), closeResource(() -> H5.H5Dclose(dataSetId))) .filter(Objects::nonNull).findFirst(); if (closureError.isPresent()) { throw new GATKException( String.format("exception when closing string retrieval on data-set '%s' in file '%s'", fullPath, file), closureError.get()); } }
Source:
public JdbcConnector( LifeCycleManager lifeCycleManager, JdbcMetadataFactory jdbcMetadataFactory, JdbcSplitManager jdbcSplitManager, JdbcRecordSetProvider jdbcRecordSetProvider, JdbcPageSinkProvider jdbcPageSinkProvider, Optional<ConnectorAccessControl> accessControl, Set<Procedure> procedures, FunctionMetadataManager functionManager, StandardFunctionResolution functionResolution, RowExpressionService rowExpressionService, JdbcClient jdbcClient) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.jdbcMetadataFactory = requireNonNull(jdbcMetadataFactory, "jdbcMetadataFactory is null"); this.jdbcSplitManager = requireNonNull(jdbcSplitManager, "jdbcSplitManager is null"); this.jdbcRecordSetProvider = requireNonNull(jdbcRecordSetProvider, "jdbcRecordSetProvider is null"); this.jdbcPageSinkProvider = requireNonNull(jdbcPageSinkProvider, "jdbcPageSinkProvider is null"); this.accessControl = requireNonNull(accessControl, "accessControl is null"); this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null")); this.functionManager = requireNonNull(functionManager); this.functionResolution = requireNonNull(functionResolution); this.rowExpressionService = requireNonNull(rowExpressionService); this.jdbcClient = requireNonNull(jdbcClient); }

Target:
public JdbcConnector( LifeCycleManager lifeCycleManager, JdbcMetadataFactory jdbcMetadataFactory, JdbcSplitManager jdbcSplitManager, JdbcRecordSetProvider jdbcRecordSetProvider, JdbcPageSinkProvider jdbcPageSinkProvider, Optional<ConnectorAccessControl> accessControl, Set<Procedure> procedures, FunctionMetadataManager functionManager, StandardFunctionResolution functionResolution, RowExpressionService rowExpressionService, JdbcClient jdbcClient) { this.lifeCycleManager = requireNonNull(lifeCycleManager, "lifeCycleManager is null"); this.jdbcMetadataFactory = requireNonNull(jdbcMetadataFactory, "jdbcMetadataFactory is null"); this.jdbcSplitManager = requireNonNull(jdbcSplitManager, "jdbcSplitManager is null"); this.jdbcRecordSetProvider = requireNonNull(jdbcRecordSetProvider, "jdbcRecordSetProvider is null"); this.jdbcPageSinkProvider = requireNonNull(jdbcPageSinkProvider, "jdbcPageSinkProvider is null"); this.accessControl = requireNonNull(accessControl, "accessControl is null"); this.procedures = ImmutableSet.copyOf(requireNonNull(procedures, "procedures is null")); this.functionManager = requireNonNull(functionManager, "functionManager is null"); this.functionResolution = requireNonNull(functionResolution, "functionResolution is null"); this.rowExpressionService = requireNonNull(rowExpressionService, "rowExpressionService is null"); this.jdbcClient = requireNonNull(jdbcClient, "jdbcClient is null"); }
Source:
public void allWithoutTask() throws Exception{ final Repo repo = new MkRepo(); final Region region = DyTasksTest.region(repo.name()); DyTasks tasks = new DyTasks(region, repo); MatcherAssert.assertThat(tasks.all().iterator().hasNext(),Matchers.equalTo(false)); }

Target:
public void allWithoutTask() throws Exception { final Repo repo = new MkRepo(); final DyTasks tasks = new DyTasks( DyTasksTest.region(repo.name()), repo ); MatcherAssert.assertThat(tasks.all(), Matchers.emptyIterable()); }
Source:
public void should_successfully_use_the_card_if_player_bought_one_in_the_previous_move_and_one_in_the_current() { playPreparationStageAndBuyCardYearOfPlentyAndPassCycle() .nextRandomDevelopmentCards(asList(YEAR_OF_PLENTY)) .BUY_CARD(1) .startTrackResourcesQuantity() .USE_CARD_YEAR_OF_PLENTY(1, "SHEEP", "WOOD").successfully() .getGameDetails(1).gameUser(1).resourcesQuantityChangedBy(0, 1, 1, 0, 0); }

Target:
public void should_successfully_use_the_card_if_player_bought_one_in_the_previous_move_and_one_in_the_current() { playPreparationStageAndBuyCardYearOfPlentyAndPassCycle() .nextRandomDevelopmentCards(asList(YEAR_OF_PLENTY)) .BUY_CARD(1) .startTrackResourcesQuantity() .startTrackDevCardsQuantity() .USE_CARD_YEAR_OF_PLENTY(1, "SHEEP", "WOOD").successfully() .getGameDetails(1) .gameUser(1).resourcesQuantityChangedBy(0, 1, 1, 0, 0) .gameUser(1).devCardsQuantityChangedBy(0, 0, 0, 0, -1); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((this.ssldRepository == null) ? 0 : this.ssldRepository.hashCode()); return result; }

Target:
public int hashCode() { return super.hashCode() + Objects.hashCode(this.ssldRepository); }
Source:
public static void assertNotNullEntries(Collection<?> collection, String name) { Objects.requireNonNull(collection, () -> "Collection '" + name + "' must be non null."); Supplier<String> entrySupplier = () -> "Collection '" + name + "' contains null entry."; collection.forEach((k) -> Objects.requireNonNull(k, entrySupplier)); }

Target:
public static void assertNotNullEntries(Collection<?> collection, String name) { Objects.requireNonNull(collection, () -> "Collection '" + name + "' must be non null."); Supplier<String> entrySupplier = () -> "Collection '" + name + "' contains null entry."; collection.forEach(k -> Objects.requireNonNull(k, entrySupplier)); }
Source:
protected void addResponseHandlers(ChannelPipeline p, Fulfiller<? super ReceivedResponse> fulfiller) { if (requestSpecBacking.isDecompressResponse()) { p.addLast(new HttpContentDecompressor()); } p.addLast("aggregator", new HttpObjectAggregator(maxContentLengthBytes)); p.addLast("httpResponseHandler", new SimpleChannelInboundHandler<FullHttpResponse>(false) { @Override public void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception { final Headers headers = new NettyHeadersBackedHeaders(msg.headers()); String contentType = headers.get(HttpHeaderConstants.CONTENT_TYPE.toString()); ByteBuf responseBuffer = initBufferReleaseOnExecutionClose(msg.content(), execution); final ByteBufBackedTypedData typedData = new ByteBufBackedTypedData(responseBuffer, DefaultMediaType.get(contentType)); final Status status = new DefaultStatus(msg.status()); success(fulfiller, new DefaultReceivedResponse(status, headers, typedData)); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ctx.close(); error(fulfiller, cause); } }); }

Target:
protected void addResponseHandlers(ChannelPipeline p, Fulfiller<? super ReceivedResponse> fulfiller) { p.addLast("aggregator", new HttpObjectAggregator(maxContentLengthBytes)); p.addLast("httpResponseHandler", new SimpleChannelInboundHandler<FullHttpResponse>(false) { @Override public void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception { final Headers headers = new NettyHeadersBackedHeaders(msg.headers()); String contentType = headers.get(HttpHeaderConstants.CONTENT_TYPE.toString()); ByteBuf responseBuffer = initBufferReleaseOnExecutionClose(msg.content(), execution); final ByteBufBackedTypedData typedData = new ByteBufBackedTypedData(responseBuffer, DefaultMediaType.get(contentType)); final Status status = new DefaultStatus(msg.status()); success(fulfiller, new DefaultReceivedResponse(status, headers, typedData)); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { ctx.close(); error(fulfiller, cause); } }); }
Source:
public JobManager( final boolean isSupportAsync, final long pollingIntervalMilliseconds, final long dialogThresholdMillisecond ) { if ( !isSupportAsync ) { logger.info( ASYNC_DISABLED ); } this.config = new Config( isSupportAsync, pollingIntervalMilliseconds, dialogThresholdMillisecond, Boolean.FALSE ); }

Target:
public JobManager( final boolean isSupportAsync, final long pollingIntervalMilliseconds, final long dialogThresholdMillisecond ) { this( isSupportAsync, pollingIntervalMilliseconds, dialogThresholdMillisecond, false ); }
Source:
public void setNumOfGroups(int numOfGroups) { if (numOfGroups != 0) { this.numOfGroups = numOfGroups; } else { int numGroupsToFill = nameListSize / DEFAULT_NAMES_PER_GROUP; this.numOfGroups = (nameListSize % DEFAULT_NAMES_PER_GROUP) > 0 ? numGroupsToFill + 1 : numGroupsToFill; } }

Target:
public void setNumOfGroups(int numOfGroups) { this.numOfGroups = numOfGroups; }
Source:
public int run() throws Exception { File f = new File(fileName); LockFile lf = new LockFile(f, FS.DETECTED); if (!lf.lock()) { throw new IOException("Cannot lock " + f); } try { JavaSchemaModel jsm = new JavaSchemaModel(ReviewDb.class); PrintWriter out = new PrintWriter(lf.getOutputStream()); try { jsm.generateProto(out); out.flush(); } finally { out.close(); } lf.commit(); } finally { lf.unlock(); } return 0; }

Target:
public int run() throws Exception { LockFile lf = new LockFile(file, FS.DETECTED); if (!lf.lock()) { throw new IOException("Cannot lock " + file); } try { JavaSchemaModel jsm = new JavaSchemaModel(ReviewDb.class); PrintWriter out = new PrintWriter(lf.getOutputStream()); try { jsm.generateProto(out); out.flush(); } finally { out.close(); } if (!lf.commit()) { throw new IOException("Could not write to " + file); } } finally { lf.unlock(); } return 0; }
Source:
public void testGetPartitionsSample() { assertEquals(getPartitionsSample(ImmutableList.of(), 0), ImmutableList.of()); assertEquals(getPartitionsSample(ImmutableList.of(partition("p1")), 0), ImmutableList.of()); assertEquals(getPartitionsSample(ImmutableList.of(partition("p1")), 1), ImmutableList.of(partition("p1"))); assertEquals(getPartitionsSample(ImmutableList.of(partition("p1")), 2), ImmutableList.of(partition("p1"))); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2")), 2), ImmutableList.of(partition("p1"), partition("p2"))); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3")), 2), getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3")), 2)); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3")), 1), getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3")), 1)); }

Target:
public void testGetPartitionsSample() { assertEquals(getPartitionsSample(ImmutableList.of(partition("p1")), 1), ImmutableList.of(partition("p1"))); assertEquals(getPartitionsSample(ImmutableList.of(partition("p1")), 2), ImmutableList.of(partition("p1"))); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2")), 2), ImmutableList.of(partition("p1"), partition("p2"))); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3")), 2), ImmutableList.of(partition("p1"), partition("p3"))); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3"), partition("p4")), 1), getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3"), partition("p4")), 1)); assertEquals( getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3"), partition("p4")), 3), getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3"), partition("p4")), 3)); assertThat(getPartitionsSample(ImmutableList.of(partition("p1"), partition("p2"), partition("p3"), partition("p4")), 3)) .contains(partition("p1"), partition("p3")); }
Source:
static void checkAliasFormat(Set<String> aliases, boolean blockAliasesWithZenodoFormat) { List<String> invalidAliases = new ArrayList<>(); invalidAliases = aliases.stream().filter(alias -> StringUtils.startsWithAny(alias, INVALID_PREFIXES)).collect(Collectors.toList()); if (invalidAliases.size() > 0) { String invalidAliasesString = String.join(", ", invalidAliases); String invalidPrefixesString = String.join(", ", INVALID_PREFIXES); throw new CustomWebApplicationException("These aliases: " + invalidAliasesString + " start with a reserved string." + " They cannot be used. Please create aliases without these prefixes: " + invalidPrefixesString, HttpStatus.SC_BAD_REQUEST); } if (blockAliasesWithZenodoFormat) { Pattern pattern = Pattern.compile(ZENDO_DOI_REGEX); List<String> aliasesWithForbiddenFormat = aliases.stream().filter(alias -> pattern.matcher(alias).matches()).collect(Collectors.toList()); if (aliasesWithForbiddenFormat.size() > 0) { String invalidAliasesString = String.join(", ", aliasesWithForbiddenFormat); throw new CustomWebApplicationException("These aliases : " + invalidAliasesString + " have a format that is forbidden." + " They cannot be used. Please create aliases without this format: " + ZENDO_DOI_REGEX, HttpStatus.SC_BAD_REQUEST); } } }

Target:
static void checkAliasFormat(Set<String> aliases, boolean blockAliasesWithZenodoFormat) { List<String> invalidAliases = aliases.stream().filter(alias -> StringUtils.startsWithAny(alias, INVALID_PREFIXES)) .collect(Collectors.toList()); if (invalidAliases.size() > 0) { String invalidAliasesString = String.join(", ", invalidAliases); String invalidPrefixesString = String.join(", ", INVALID_PREFIXES); throw new CustomWebApplicationException("These aliases: " + invalidAliasesString + " start with a reserved string." + " They cannot be used. Please create aliases without these prefixes: " + invalidPrefixesString, HttpStatus.SC_BAD_REQUEST); } if (blockAliasesWithZenodoFormat) { List<String> aliasesWithForbiddenFormat = aliases.stream().filter(alias -> ZENODO_DOI_PATTERN.matcher(alias).matches()) .collect(Collectors.toList()); if (aliasesWithForbiddenFormat.size() > 0) { String invalidAliasesString = String.join(", ", aliasesWithForbiddenFormat); throw new CustomWebApplicationException("These aliases : " + invalidAliasesString + " have a format that is forbidden." + " They cannot be used. Please create aliases without this format: " + ZENDO_DOI_REGEX, HttpStatus.SC_BAD_REQUEST); } } }
Source:
private void registerCQ(SlaveState slaveState) { Class<?> clazz; try { clazz = slaveState.getClassLoader().loadClass(queryObjectClass); } catch (ClassNotFoundException e) { throw new IllegalArgumentException("Cannot load class " + queryObjectClass, e); } Queryable.QueryBuilder builder = queryable.getBuilder(null, clazz); for (Condition condition : conditions) { condition.apply(builder); } if (orderBy != null) { for (SortElement se : orderBy) { builder.orderBy(new Queryable.SelectExpression(se.attribute), se.asc ? Queryable.SortOrder.ASCENDING : Queryable.SortOrder.DESCENDING); } } if (projection != null) { Queryable.SelectExpression[] projections = new Queryable.SelectExpression[projection.length]; for (int i = 0; i < projection.length; i++) { projections[i] = new Queryable.SelectExpression(projection[i]); } builder.projection(projections); } else if (aggregatedProjection != null && !aggregatedProjection.isEmpty()) { Queryable.SelectExpression[] projections = new Queryable.SelectExpression[aggregatedProjection.size()]; for (int i = 0; i < aggregatedProjection.size(); i++) { projections[i] = aggregatedProjection.get(i).toSelectExpression(); } builder.projection(projections); } if (offset >= 0) { builder.offset(offset); } if (limit >= 0) { builder.limit(limit); } Query query = builder.build(); slaveState.put(ContinuousQuery.QUERY, query); ContinuousQuery.ContinuousQueryListener cqListener = new ContinuousQuery.ContinuousQueryListener() { @Override public void onEntryJoined(Object key, Object value) { statistics.registerRequest(getResponseTime(key), ContinuousQuery.ENTRY_JOINED); log.trace("Entry joined " + key + " -> " + value); } @Override public void onEntryLeft(Object key) { statistics.registerRequest(getResponseTime(key), ContinuousQuery.ENTRY_LEFT); log.trace("Entry left " + key); } }; slaveState.put(ContinuousQuery.LISTENER, cqListener); continuousQueryTrait.createContinuousQuery(cacheName, query, cqListener); }

Target:
private void registerCQ(SlaveState slaveState) { if ((projectionAggregated != null && !projectionAggregated.isEmpty()) || (groupBy != null && groupBy.length != 0) || (orderByAggregatedColumns != null && !orderByAggregatedColumns.isEmpty())) { throw new IllegalStateException("Aggregations are not supported in continuous queries!"); } Queryable.QueryBuilder builder = constructBuilder(); Query query = builder.build(); slaveState.put(ContinuousQuery.QUERY, query); ContinuousQuery.ContinuousQueryListener cqListener = new ContinuousQuery.ContinuousQueryListener() { @Override public void onEntryJoined(Object key, Object value) { statistics.registerRequest(getResponseTime(key), ContinuousQuery.ENTRY_JOINED); log.trace("Entry joined " + key + " -> " + value); } @Override public void onEntryLeft(Object key) { statistics.registerRequest(getResponseTime(key), ContinuousQuery.ENTRY_LEFT); log.trace("Entry left " + key); } }; slaveState.put(ContinuousQuery.LISTENER, cqListener); continuousQueryTrait.createContinuousQuery(cacheName, query, cqListener); }
Source:
@Override public IgniteInternalFuture<?> removeAllAsync(@Nullable final Collection<? extends K> keys) { if (F.isEmpty(keys)) return new GridFinishedFuture<Object>(); final boolean statsEnabled = ctx.statisticsEnabled(); boolean profilingEnabled = ctx.kernalContext().metric().profilingEnabled(); final long start = statsEnabled || profilingEnabled ? System.nanoTime() : 0L; if (keyCheck) validateCacheKeys(keys); warnIfUnordered(keys, BulkOperation.REMOVE); IgniteInternalFuture<Object> fut = removeAllAsync0(keys); if (statsEnabled) fut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start)); if (profilingEnabled) fut.listen(new ProfileClosure<>(CacheOperationType.REMOVE_ALL, start)); return fut; }

Target:
@Override public IgniteInternalFuture<?> removeAllAsync(@Nullable final Collection<? extends K> keys) { if (F.isEmpty(keys)) return new GridFinishedFuture<Object>(); final boolean statsEnabled = ctx.statisticsEnabled(); final boolean performanceStatsEnabled = ctx.kernalContext().performanceStatistics().enabled(); final long start = statsEnabled || performanceStatsEnabled ? System.nanoTime() : 0L; if (keyCheck) validateCacheKeys(keys); warnIfUnordered(keys, BulkOperation.REMOVE); IgniteInternalFuture<Object> fut = removeAllAsync0(keys); if (statsEnabled) fut.listen(new UpdateRemoveTimeStatClosure<>(metrics0(), start)); if (performanceStatsEnabled) fut.listen(f -> writeStatistics(OperationType.CACHE_REMOVE_ALL, start)); return fut; }
Source:
public void setRecipients(Person[] list) { this.recipientsCache = list; try { Person to = ZulipApp.get().getDao(Person.class, true).queryBuilder().where().eq(Person.EMAIL_FIELD, list[0].getEmail()).queryForFirst();; if(list.length == 1) { setRecipients(to.getId() + ""); return; } Person from = ZulipApp.get().getDao(Person.class, true).queryBuilder().where().eq(Person.EMAIL_FIELD, list[1].getEmail()).queryForFirst(); if(to == null && from != null) { setRecipients(""+ from.getId()); } if(to != null && from == null) { setRecipients(to.getId() + ""); } setRecipients(to.getId() + "," + from.getId()); return; } catch (Exception e) { e.printStackTrace(); } this.recipients = (recipientId == 0 && senderId == 0) ? recipientList(list) : recipientId + "," + senderId; }

Target:
public void setRecipients(Person[] list) { this.recipientsCache = list; try { Person to = ZulipApp.get().getDao(Person.class, true).queryBuilder().where().eq(Person.EMAIL_FIELD, list[0].getEmail()).queryForFirst();; if(list.length == 1) { setRecipients(to.getId() + ""); return; } Person from = ZulipApp.get().getDao(Person.class, true).queryBuilder().where().eq(Person.EMAIL_FIELD, list[1].getEmail()).queryForFirst(); if(to == null && from != null) { setRecipients(""+ from.getId()); } if(to != null && from == null) { setRecipients(to.getId() + ""); } setRecipients(to.getId() + "," + from.getId()); return; } catch (Exception e) { ZLog.logException(e); } this.recipients = (recipientId == 0 && senderId == 0) ? recipientList(list) : recipientId + "," + senderId; }
Source:
public void test_CentOS_6_3() throws Exception { runTest(ImmutableMap.of("skipJcloudsSshing", true, "imageId", "us-east-1/ami-a96b01c0", "hardwareId", SMALL_HARDWARE_ID)); }

Target:
public void test_CentOS_6_3() throws Exception { super.test_CentOS_6_3(); }
Source:
public Integer nextAction(INDArray input) { synchronized (ACPolicy.class) { INDArray output = actorCritic.outputAll(input)[1]; if (rnd == null) { return Learning.getMaxAction(output); } float rVal = rnd.nextFloat(); for (int i = 0; i < output.length(); i++) { if (rVal < output.getFloat(i)) { return i; } else rVal -= output.getFloat(i); } throw new RuntimeException("Output from network is not a probability distribution: " + output); } }

Target:
public Integer nextAction(INDArray input) { INDArray output = actorCritic.outputAll(input)[1]; if (rnd == null) { return Learning.getMaxAction(output); } float rVal = rnd.nextFloat(); for (int i = 0; i < output.length(); i++) { if (rVal < output.getFloat(i)) { return i; } else rVal -= output.getFloat(i); } throw new RuntimeException("Output from network is not a probability distribution: " + output); }
Source:
public OrcHadoopInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @Nullable @JsonProperty("binaryAsString") Boolean binaryAsString ) { this.parseSpec = parseSpec; this.binaryAsString = binaryAsString == null ? false : binaryAsString; final JSONPathSpec flattenSpec; if ((parseSpec instanceof OrcParseSpec)) { flattenSpec = ((OrcParseSpec) parseSpec).getFlattenSpec(); } else { flattenSpec = JSONPathSpec.DEFAULT; } this.groupFlattener = ObjectFlatteners.create(flattenSpec, new OrcStructFlattenerMaker(false)); this.parser = new MapInputRowParser(parseSpec); }

Target:
public OrcHadoopInputRowParser( @JsonProperty("parseSpec") ParseSpec parseSpec, @Nullable @JsonProperty("binaryAsString") Boolean binaryAsString ) { this.parseSpec = parseSpec; this.binaryAsString = binaryAsString == null ? false : binaryAsString; final JSONPathSpec flattenSpec; if (parseSpec instanceof OrcParseSpec) { flattenSpec = ((OrcParseSpec) parseSpec).getFlattenSpec(); } else { flattenSpec = JSONPathSpec.DEFAULT; } this.orcStructFlattener = ObjectFlatteners.create(flattenSpec, new OrcStructFlattenerMaker(this.binaryAsString)); this.parser = new MapInputRowParser(parseSpec); }
Source:
protected void checkAccessControlForStudentFeedbackSubmission( StudentAttributes student, FeedbackSessionAttributes feedbackSession) { String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); if (!StringHelper.isEmpty(moderatedPerson)) { gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, student.getSection(), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); } else if (!StringHelper.isEmpty(previewAsPerson)) { gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } else { gateKeeper.verifyAccessible(student, feedbackSession); } }

Target:
protected void checkAccessControlForStudentFeedbackSubmission( StudentAttributes student, FeedbackSessionAttributes feedbackSession) { if (student == null) { throw new UnauthorizedAccessException("Trying to access system using a non-existent student entity"); } String moderatedPerson = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_MODERATED_PERSON); String previewAsPerson = getRequestParamValue(Const.ParamsNames.PREVIEWAS); if (!StringHelper.isEmpty(moderatedPerson)) { gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, student.getSection(), Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION_COMMENT_IN_SECTIONS); } else if (!StringHelper.isEmpty(previewAsPerson)) { gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(feedbackSession.getCourseId(), userInfo.getId()), feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); } else { gateKeeper.verifyAccessible(student, feedbackSession); } }
Source:
public SetMonitorServiceCommand() { }

Target:
protected SetMonitorServiceCommand() { }
Source:
public static void main(String[] args) { List<Car> cars = Iterating.createCars(); List<String> modelsImperative = ImperativeProgramming.getModelsAfter2000UsingFor(cars); LOGGER.info(modelsImperative.toString()); List<String> modelsFunctional = FunctionalProgramming.getModelsAfter2000UsingPipeline(cars); LOGGER.info(modelsFunctional.toString()); }

Target:
public static void main(String[] args) { List<Car> cars = CarFactory.createCars(); List<String> modelsImperative = ImperativeProgramming.getModelsAfter2000(cars); LOGGER.info(modelsImperative.toString()); List<String> modelsFunctional = FunctionalProgramming.getModelsAfter2000(cars); LOGGER.info(modelsFunctional.toString()); Map<Category, List<Car>> groupingByCategoryImperative = ImperativeProgramming.getGroupingOfCarsByCategory(cars); LOGGER.info(groupingByCategoryImperative.toString()); Map<Category, List<Car>> groupingByCategoryFunctional = FunctionalProgramming.getGroupingOfCarsByCategory(cars); LOGGER.info(groupingByCategoryFunctional.toString()); Person john = new Person(cars); List<Car> sedansOwnedImperative = ImperativeProgramming.getSedanCarsOwnedSortedByDate(Arrays.asList(john)); LOGGER.info(sedansOwnedImperative.toString()); List<Car> sedansOwnedFunctional = FunctionalProgramming.getSedanCarsOwnedSortedByDate(Arrays.asList(john)); LOGGER.info(sedansOwnedFunctional.toString()); }
Source:
public void executeFSHooksArrayTest() { final String fsName = "dora"; AtomicBoolean executedWithLambda = new AtomicBoolean(false); FileSystemHooks.FileSystemHook hook = spy(new FileSystemHooks.FileSystemHook() { @Override public void execute(FileSystemHookExecutionContext context) { assertEquals(fsName, context.getFsName()); } }); FileSystemHooks.FileSystemHook lambdaHook = context -> { assertEquals(fsName, context.getFsName()); executedWithLambda.set(true); }; JGitFSHooks.executeFSHooks(Arrays.asList(hook, lambdaHook), FileSystemHooks.ExternalUpdate, new FileSystemHookExecutionContext(fsName)); verify(hook).execute(any()); assertTrue(executedWithLambda.get()); }

Target:
public void executeFSHooksArrayTest() { FileSystemHookExecutionContext ctx = new FileSystemHookExecutionContext(FS_NAME); testExecuteFSHooksArray(ctx, FileSystemHooks.ExternalUpdate); ctx.addParam(FileSystemHooksConstants.POST_COMMIT_EXIT_CODE, EXIT_CODE); testExecuteFSHooksArray(ctx, FileSystemHooks.PostCommit); }
Source:
public Function<Result<TopNResultValue>, Result<TopNResultValue>> makePostComputeManipulatorFn( final TopNQuery query, final MetricManipulationFn fn ) { return new Function<Result<TopNResultValue>, Result<TopNResultValue>>() { private String dimension = query.getDimensionSpec().getOutputName(); @Override public Result<TopNResultValue> apply(@Nullable Result<TopNResultValue> result) { List<Map<String, Object>> serializedValues = Lists.newArrayList( Iterables.transform( result.getValue(), new Function<DimensionAndMetricValueExtractor, Map<String, Object>>() { @Override public Map<String, Object> apply(@Nullable DimensionAndMetricValueExtractor input) { final Map<String, Object> values = Maps.newHashMap(); for (PostAggregator postAgg : query.getPostAggregatorSpecs()) { Object calculatedPostAgg = input.getMetric(postAgg.getName()); if (calculatedPostAgg != null) { values.put(postAgg.getName(), calculatedPostAgg); } else { values.put(postAgg.getName(), postAgg.compute(input.getBaseObject())); } } for (AggregatorFactory agg : query.getAggregatorSpecs()) { values.put(agg.getName(), fn.manipulate(agg, input.getMetric(agg.getName()))); } values.put(dimension, input.getDimensionValue(dimension)); return values; } } ) ); return new Result<TopNResultValue>( result.getTimestamp(), new TopNResultValue(serializedValues) ); } }; }

Target:
public Function<Result<TopNResultValue>, Result<TopNResultValue>> makePostComputeManipulatorFn( final TopNQuery query, final MetricManipulationFn fn ) { return new Function<Result<TopNResultValue>, Result<TopNResultValue>>() { private String dimension = query.getDimensionSpec().getOutputName(); @Override public Result<TopNResultValue> apply(Result<TopNResultValue> result) { List<Map<String, Object>> serializedValues = Lists.newArrayList( Iterables.transform( result.getValue(), new Function<DimensionAndMetricValueExtractor, Map<String, Object>>() { @Override public Map<String, Object> apply(DimensionAndMetricValueExtractor input) { final Map<String, Object> values = Maps.newHashMap(); for (PostAggregator postAgg : query.getPostAggregatorSpecs()) { Object calculatedPostAgg = input.getMetric(postAgg.getName()); if (calculatedPostAgg != null) { values.put(postAgg.getName(), calculatedPostAgg); } else { values.put(postAgg.getName(), postAgg.compute(input.getBaseObject())); } } for (AggregatorFactory agg : query.getAggregatorSpecs()) { values.put(agg.getName(), fn.manipulate(agg, input.getMetric(agg.getName()))); } values.put(dimension, input.getDimensionValue(dimension)); return values; } } ) ); return new Result<TopNResultValue>( result.getTimestamp(), new TopNResultValue(serializedValues) ); } }; }
Source:
private OrchestratorStateParams createSshStateParams(Stack stack, String user, KeyPair keyPair, String authKeysComment, String saltState) { Cluster cluster = stack.getCluster(); Set<Node> nodes = stackUtil.collectReachableNodes(stack); OrchestratorStateParams stateParams = new OrchestratorStateParams(); stateParams.setState(saltState); stateParams.setPrimaryGatewayConfig(gatewayConfigService.getGatewayConfig(stack, stack.getPrimaryGatewayInstance(), stack.getCluster().hasGateway())); stateParams.setTargetHostNames(nodes.stream().map(Node::getHostname).collect(Collectors.toSet())); stateParams.setAllNodes(nodes); stateParams.setExitCriteriaModel(ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stack.getId(), cluster.getId())); stateParams.setStateParams(createSshParams(user, keyPair, authKeysComment)); return stateParams; }

Target:
private OrchestratorStateParams createSshStateParams(Stack stack, String user, KeyPair keyPair, String authKeysComment, String saltState) { Cluster cluster = stack.getCluster(); Set<Node> nodes = stackUtil.collectReachableNodes(stack); OrchestratorStateParams stateParams = new OrchestratorStateParams(); stateParams.setState(saltState); stateParams.setPrimaryGatewayConfig(gatewayConfigService.getGatewayConfig(stack, stack.getPrimaryGatewayInstance(), stack.getCluster().hasGateway())); stateParams.setTargetHostNames(nodes.stream().map(Node::getHostname).collect(Collectors.toSet())); stateParams.setAllNodes(nodes); stateParams.setExitCriteriaModel(ClusterDeletionBasedExitCriteriaModel.clusterDeletionBasedModel(stack.getId(), cluster.getId())); stateParams.setStateParams(createSshParams(user, keyPair, authKeysComment)); OrchestratorStateRetryParams retryParams = new OrchestratorStateRetryParams(); retryParams.setMaxRetry(SSH_KEY_OPERATION_RETRY_COUNT); stateParams.setStateRetryParams(retryParams); return stateParams; }
Source:
public void runProtected(final Test test, Protectable p) { try { p.protect(); } catch (AssertionFailedError e) { addFailure(test, e); } catch (ThreadDeath e) { throw e; } catch (Throwable t) { addError(test, t); } }

Target:
public void runProtected(final Test test, Protectable p) { try { p.protect(); } catch (AssertionFailedError e) { addFailure(test, e); } catch (ThreadDeath e) { throw e; } catch (Throwable e) { addError(test, e); } }
Source:
public ISMRGarbageInfo merge(ISMRGarbageInfo other) { if (other instanceof MultiObjectSMREntryGarbageInfo) { MultiObjectSMREntryGarbageInfo deduplicatedGCInfo = new MultiObjectSMREntryGarbageInfo(); ((MultiObjectSMREntryGarbageInfo) other).getStreamIdToGarbageMap().forEach((streamId, garbageMap) -> { if (garbageMap.getAllGarbageInfo(streamId).size() > 0) { if (streamIdToGarbageMap.containsKey(streamId)) { MultiSMREntryGarbageInfo perStreamDeduplicatedGCInfo = (MultiSMREntryGarbageInfo) streamIdToGarbageMap.get(streamId).merge(garbageMap); if (perStreamDeduplicatedGCInfo.getGarbageMap().size() > 0) { deduplicatedGCInfo.add(streamId, perStreamDeduplicatedGCInfo); } } else { deduplicatedGCInfo.add(streamId, garbageMap); this.add(streamId, garbageMap); } } }); return deduplicatedGCInfo; } else { throw new RuntimeException("Different types of ISMRGarbageInfo cannot merge."); } }

Target:
public ISMRGarbageInfo merge(ISMRGarbageInfo other) { if (other instanceof MultiObjectSMREntryGarbageInfo) { MultiObjectSMREntryGarbageInfo deduplicatedGCInfo = new MultiObjectSMREntryGarbageInfo(); ((MultiObjectSMREntryGarbageInfo) other).getStreamIdToGarbageMap().forEach((streamId, garbageMap) -> { if (garbageMap.getAllGarbageInfo(streamId).size() > 0) { if (streamIdToGarbageMap.containsKey(streamId)) { MultiSMREntryGarbageInfo perStreamDeduplicatedGCInfo = (MultiSMREntryGarbageInfo) streamIdToGarbageMap.get(streamId).merge(garbageMap); if (perStreamDeduplicatedGCInfo.getGarbageMap().size() > 0) { deduplicatedGCInfo.add(streamId, perStreamDeduplicatedGCInfo); } } else { deduplicatedGCInfo.add(streamId, garbageMap); this.add(streamId, garbageMap); } } }); return deduplicatedGCInfo; } else { throw new IllegalArgumentException("Different types of ISMRGarbageInfo cannot merge."); } }
Source:
public StramLocalCluster(LogicalPlan dag) throws IOException, ClassNotFoundException { dag.validate(); cloneLogicalPlan(dag); final Path pathUri; String appPath = dag.getAttributes().get(LogicalPlan.APPLICATION_PATH); if (appPath == null) { pathUri = new Path(DEFAULT_APP_DIR.toURI()); dag.getAttributes().put(LogicalPlan.APPLICATION_PATH, pathUri.toString()); } else { Path tmp = new Path(appPath); if (!tmp.isAbsolute()) { pathUri = new Path(new File(appPath).toURI()); } else { pathUri = tmp; } } try { FileContext.getLocalFSFileContext().delete(pathUri, true); } catch (IllegalArgumentException e) { throw e; } catch (IOException e) { throw new RuntimeException("could not cleanup test dir", e); } dag.getAttributes().put(LogicalPlan.APPLICATION_ID, "app_local_" + System.currentTimeMillis()); if (dag.getAttributes().get(OperatorContext.STORAGE_AGENT) == null) { dag.setAttribute(OperatorContext.STORAGE_AGENT, new AsyncFSStorageAgent(new Path(pathUri, LogicalPlan.SUBDIR_CHECKPOINTS).toString(), null)); } ifNeededStartBufferServer(); this.dnmgr = new StreamingContainerManager(dag); this.umbilical = new UmbilicalProtocolLocalImpl(); }

Target:
public StramLocalCluster(LogicalPlan dag) throws IOException, ClassNotFoundException { dag.validate(); cloneLogicalPlan(dag); final Path pathUri; String appPath = dag.getAttributes().get(LogicalPlan.APPLICATION_PATH); if (appPath == null) { pathUri = new Path(DEFAULT_APP_DIR.toURI()); dag.getAttributes().put(LogicalPlan.APPLICATION_PATH, pathUri.toString()); } else { Path tmp = new Path(appPath); if (!tmp.isAbsolute()) { pathUri = new Path(new File(appPath).toURI()); } else { pathUri = tmp; } } try { FileContext.getLocalFSFileContext().delete(pathUri, true); } catch (IllegalArgumentException e) { throw e; } catch (IOException e) { throw new RuntimeException("could not cleanup test dir", e); } dag.getAttributes().put(LogicalPlan.APPLICATION_ID, "app_local_" + System.currentTimeMillis()); if (dag.getAttributes().get(OperatorContext.STORAGE_AGENT) == null) { dag.setAttribute(OperatorContext.STORAGE_AGENT, new AsyncFSStorageAgent(new Path(pathUri, LogicalPlan.SUBDIR_CHECKPOINTS).toString(), null)); } this.dnmgr = new StreamingContainerManager(dag); this.umbilical = new UmbilicalProtocolLocalImpl(); }
Source:
protected AbstractS3ACommitter( Path outputPath, TaskAttemptContext context) throws IOException { super(outputPath, context); Preconditions.checkArgument(outputPath != null, "null output path"); Preconditions.checkArgument(context != null, "null job context"); this.jobContext = context; this.role = "Task committer " + context.getTaskAttemptID(); setConf(context.getConfiguration()); Pair<String, JobUUIDSource> id = buildJobUUID( conf, context.getJobID()); uuid = id.getLeft(); uuidSource = id.getRight(); LOG.info("Job UUID source {}", getUUID(), getUUIDSource().getText()); initOutput(outputPath); LOG.debug("{} instantiated for job \"{}\" ID with destination {}", role, jobName(context), jobIdString(context), outputPath); S3AFileSystem fs = getDestS3AFS(); createJobMarker = context.getConfiguration().getBoolean( CREATE_SUCCESSFUL_JOB_OUTPUT_DIR_MARKER, DEFAULT_CREATE_SUCCESSFUL_JOB_DIR_MARKER); commitOperations = new CommitOperations(fs); }

Target:
protected AbstractS3ACommitter( Path outputPath, TaskAttemptContext context) throws IOException { super(outputPath, context); Preconditions.checkArgument(outputPath != null, "null output path"); Preconditions.checkArgument(context != null, "null job context"); this.jobContext = context; this.role = "Task committer " + context.getTaskAttemptID(); setConf(context.getConfiguration()); Pair<String, JobUUIDSource> id = buildJobUUID( conf, context.getJobID()); this.uuid = id.getLeft(); this.uuidSource = id.getRight(); LOG.info("Job UUID source {}", getUUID(), getUUIDSource().getText()); initOutput(outputPath); LOG.debug("{} instantiated for job \"{}\" ID with destination {}", role, jobName(context), jobIdString(context), outputPath); S3AFileSystem fs = getDestS3AFS(); this.createJobMarker = context.getConfiguration().getBoolean( CREATE_SUCCESSFUL_JOB_OUTPUT_DIR_MARKER, DEFAULT_CREATE_SUCCESSFUL_JOB_DIR_MARKER); this.commitOperations = new CommitOperations(fs); }
Source:
private String sendMessage(String data, int timeout) throws IOException { logger.debug("Sent request...'{}'", data); out.write(data.getBytes()); out.flush(); String resp = ""; long startTime = System.currentTimeMillis(); long elapsedTime = 0; while (elapsedTime < timeout) { int availableBytes = in.available(); if (availableBytes > 0) { byte[] tmpData = new byte[availableBytes]; int readBytes = in.read(tmpData, 0, availableBytes); resp = resp.concat(new String(tmpData, 0, readBytes)); if (resp.length() > 7) { return resp; } } else { try { Thread.sleep(100); } catch (InterruptedException e) { logger.warn("failed reading reesponse"); } } elapsedTime = Math.abs((new Date()).getTime() - startTime); } return resp; }

Target:
private String sendMessage(String data, int timeout) throws IOException { logger.debug("Sent request...'{}'", data); out.write(data.getBytes()); out.flush(); String resp = ""; long startTime = System.currentTimeMillis(); long elapsedTime = 0; while (elapsedTime < timeout) { int availableBytes = in.available(); if (availableBytes > 0) { byte[] tmpData = new byte[availableBytes]; int readBytes = in.read(tmpData, 0, availableBytes); resp = resp.concat(new String(tmpData, 0, readBytes)); if (resp.length() > 7) { return resp; } } else { try { Thread.sleep(100); } catch (InterruptedException e) { logger.warn("failed reading response"); } } elapsedTime = Math.abs((new Date()).getTime() - startTime); } return resp; }
Source:
protected void executeQueryCommand() { List<AuthenticationProfile> profiles = AuthenticationProfileRepository.getInstance().getProfiles(); List<String> names = new ArrayList<>(profiles.size()); for (AuthenticationProfile profile : profiles) { names.add(profile.getName()); } sort(names, new LoginDomainComparator(Config.<String> getValue(ConfigValues.AdminDomain))); getQueryReturnValue().setReturnValue(names); }

Target:
protected void executeQueryCommand() { List<AuthenticationProfile> profiles = AuthenticationProfileRepository.getInstance().getProfiles(); List<String> names = new ArrayList<>(profiles.size()); for (AuthenticationProfile profile : profiles) { names.add(profile.getName()); } sort(names); getQueryReturnValue().setReturnValue(names); }