auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Set<Link> getLinks() { List<String> links = this.headers.get(HttpHeaders.LINK); if (links == null || links.isEmpty()) { return Collections.emptySet(); } try { Set<Link> result = new HashSet<Link>(links.size()); for (String l : links) { for (String p : l.split(",")) { result.add(Link.valueOf(p.trim())); } } return result; } catch (IllegalArgumentException e) { throw exception(HttpHeaders.LINK, links, e); } }

Target:
public Set<Link> getLinks() { List<String> links = this.headers.get(HttpHeaders.LINK); if (links == null || links.isEmpty()) { return Collections.emptySet(); } try { Set<Link> result = new HashSet<Link>(links.size()); StringBuilder linkString; for (String link : links) { linkString = new StringBuilder(); StringTokenizer st = new StringTokenizer(link, "<>,", true); boolean linkOpen = false; while (st.hasMoreTokens()) { String n = st.nextToken(); if (n.equals("<")) { linkOpen = true; } else if (n.equals(">")) { linkOpen = false; } else if (!linkOpen && n.equals(",")) { result.add(Link.valueOf(linkString.toString().trim())); linkString = new StringBuilder(); continue; } linkString.append(n); } if (linkString.length() > 0) { result.add(Link.valueOf(linkString.toString().trim())); } } return result; } catch (IllegalArgumentException e) { throw exception(HttpHeaders.LINK, links, e); } }
Source:
public void handlingException() { List<DetectLanguageInput> inputs = Arrays.asList( new DetectLanguageInput("1", "This is written in English.", "us"), new DetectLanguageInput("1", "Este es un document escrito en Español.", "es") ); try { textAnalyticsClient.detectLanguageBatch(inputs, null, Context.NONE); } catch (HttpResponseException e) { System.out.println(e.getMessage()); } }

Target:
public void handlingException() { List<DetectLanguageInput> inputs = Arrays.asList( new DetectLanguageInput("1", "This is written in English.", "us"), new DetectLanguageInput("1", "Este es un documento escrito en Español.", "es") ); try { textAnalyticsClient.detectLanguageBatch(inputs, null, Context.NONE); } catch (HttpResponseException e) { System.out.println(e.getMessage()); } }
Source:
public void visitCallExpression(CallExpressionTree tree) { if (tree.types().contains(ObjectType.FrameworkType.JQUERY_SELECTOR_OBJECT)) { LiteralTree parameter = getSelectorParameter(tree); if (parameter != null) { Map<String, List<CallExpressionTree>> currentSelectors = selectors.peek(); String value = parameter.value(); if (!currentSelectors.containsKey(value)) { currentSelectors.put(value, new ArrayList<>()); } currentSelectors.get(value).add(tree); } } super.visitCallExpression(tree); }

Target:
public void visitCallExpression(CallExpressionTree tree) { if (tree.types().contains(ObjectType.FrameworkType.JQUERY_SELECTOR_OBJECT)) { LiteralTree parameter = getSelectorParameter(tree); if (parameter != null) { String value = parameter.value(); selectors.peek().put(value, tree); } } super.visitCallExpression(tree); }
Source:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> contentAnalyzeActivationOperation( String sourceUrl) { return (pollingContext) -> { try { return service.analyzeLayoutAsyncWithResponseAsync(new SourcePath().setSource(sourceUrl)) .map(response -> new OperationResult(parseModelId(response.getDeserializedHeaders().getOperationLocation()))); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }

Target:
private Function<PollingContext<OperationResult>, Mono<OperationResult>> contentAnalyzeActivationOperation( String sourceUrl) { return (pollingContext) -> { try { Objects.requireNonNull(sourceUrl, "'sourceUrl' is required and cannot be null."); return service.analyzeLayoutAsyncWithResponseAsync(new SourcePath().setSource(sourceUrl)) .map(response -> new OperationResult(parseModelId(response.getDeserializedHeaders().getOperationLocation()))); } catch (RuntimeException ex) { return monoError(logger, ex); } }; }
Source:
protected double getOperandCost() throws StandardException { return operand == null ? 0.0f : operand.getBaseOperationCost(); }

Target:
protected double getOperandCost() throws StandardException { return operand == null ? 0.0 : operand.getBaseOperationCost(); }
Source:
private List<Mempool> getMemPools() { List<Mempool> memPoolList = new ArrayList<Mempool>(); Mempool memPool = new Mempool(); memPool.setAllocCount(0); memPool.setColdCount(1024); memPool.setHotCount(0); memPool.setMaxAlloc(0); memPool.setMaxStdAlloc(0); memPool.setName("v1-server:fd_t"); memPool.setPadddedSize(100); memPool.setPoolMisses(0); memPoolList.add(memPool); return memPoolList; }

Target:
private List<Mempool> getMemPools() { Mempool memPool = new Mempool(); memPool.setAllocCount(0); memPool.setColdCount(1024); memPool.setHotCount(0); memPool.setMaxAlloc(0); memPool.setMaxStdAlloc(0); memPool.setName("v1-server:fd_t"); memPool.setPadddedSize(100); memPool.setPoolMisses(0); return Collections.singletonList(memPool); }
Source:
private void reindexIncrementally( ChangeJournal journal ) { long earliestTimestamp = Long.MAX_VALUE; List<IndexProvider> incrementalIndexingProviders = new ArrayList<>(); for (IndexProvider provider : indexManager.getProviders()) { Long latestIndexUpdateTime = provider.getLatestIndexUpdateTime(); if (latestIndexUpdateTime == null) { logger.warn(JcrI18n.warnIncrementalIndexingNotSupported, provider.getName()); continue; } incrementalIndexingProviders.add(provider); earliestTimestamp = Math.min(earliestTimestamp, latestIndexUpdateTime); } if (incrementalIndexingProviders.isEmpty()) { return; } assert earliestTimestamp != Long.MAX_VALUE; Set<NodeKey> changedNodes = journal.changedNodesSince(earliestTimestamp); IndexWriter writer = CompositeIndexWriter.create(incrementalIndexingProviders); RepositoryCache repositoryCache = runningState.repositoryCache(); for (String workspaceName : repositoryCache.getWorkspaceNames()) { if (logger.isDebugEnabled()) { logger.debug("Performing incremental reindexing since '{0}' for repository '{1}' on workspace '{2}'", new Date(earliestTimestamp), repositoryCache.getName(), workspaceName); } WorkspaceCache workspaceCache = repositoryCache.getWorkspaceCache(workspaceName); reindexSince(workspaceCache, writer, changedNodes); } }

Target:
private void reindexIncrementally( ChangeJournal journal ) { long earliestTimestamp = Long.MAX_VALUE; List<IndexProvider> incrementalIndexingProviders = new ArrayList<>(); for (IndexProvider provider : indexManager.getProviders()) { Long latestIndexUpdateTime = provider.getLatestIndexUpdateTime(); if (latestIndexUpdateTime == null) { logger.warn(JcrI18n.warnIncrementalIndexingNotSupported, provider.getName()); continue; } incrementalIndexingProviders.add(provider); earliestTimestamp = Math.min(earliestTimestamp, latestIndexUpdateTime); } if (incrementalIndexingProviders.isEmpty()) { return; } assert earliestTimestamp != Long.MAX_VALUE; Iterator<NodeKey> changedNodes = journal.changedNodesSince(earliestTimestamp); IndexWriter writer = CompositeIndexWriter.create(incrementalIndexingProviders); RepositoryCache repositoryCache = runningState.repositoryCache(); for (String workspaceName : repositoryCache.getWorkspaceNames()) { if (logger.isDebugEnabled()) { logger.debug("Performing incremental reindexing since '{0}' for repository '{1}' on workspace '{2}'", new Date(earliestTimestamp), repositoryCache.getName(), workspaceName); } WorkspaceCache workspaceCache = repositoryCache.getWorkspaceCache(workspaceName); reindexSince(workspaceCache, writer, changedNodes); } }
Source:
public void testContainerSnapWithArrange() throws Exception { final UIDiagramRepresentation diagramRepresentation = localSession.newDiagramRepresentation("new Top/Bottom Container Ports And Edges", "Top/Bottom Container Ports And Edges").on(mainEPackage) .withDefaultName().ok(); final SWTBotSiriusDiagramEditor editor = diagramRepresentation.open().getEditor(); SWTBotUtils.waitAllUiEvents(); IGraphicalEditPart LF6 = (IGraphicalEditPart) editor.getEditPart("LF6", DNodeContainer2EditPart.class).part(); IGraphicalEditPart LF7 = (IGraphicalEditPart) editor.getEditPart("LF7", DNodeContainer2EditPart.class).part(); assertTrue("For container, the x coordinate or y coordinate of top left corner should be on the grid should be on the grid.", checkLocationAlignOnGrid(LF6)); assertTrue("For container, the x coordinate or y coordinate of top left corner should be on the grid should be on the grid.", checkLocationAlignOnGrid(LF7)); }

Target:
public void testContainerSnapWithArrange() throws Exception { final UIDiagramRepresentation diagramRepresentation = localSession.newDiagramRepresentation("new Top/Bottom Container Ports And Edges", "Top/Bottom Container Ports And Edges").on(mainEPackage) .withDefaultName().ok(); final SWTBotSiriusDiagramEditor editor = diagramRepresentation.open().getEditor(); SWTBotUtils.waitAllUiEvents(); IGraphicalEditPart LF6 = (IGraphicalEditPart) editor.getEditPart("LF6", DNodeContainer2EditPart.class).part(); checkLocationAlignOnGrid(LF6, "container LF6"); IGraphicalEditPart LF7 = (IGraphicalEditPart) editor.getEditPart("LF7", DNodeContainer2EditPart.class).part(); checkLocationAlignOnGrid(LF7, "container LF7"); }
Source:
private TupleMappers(TupleMappers that) { this.columns = that.columns; }

Target:
private TupleMappers(TupleMappers that) { System.arraycopy(that.columns, 0, this.columns, 0, Tuple.MAX_ARITY); }
Source:
public void testBroadcastBatchTranslationThrowsException() throws Exception { final MapStateDescriptor<Long, Long> utterDescriptor = new MapStateDescriptor<>( "broadcast-state", BasicTypeInfo.LONG_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); final List<Long> input = new ArrayList<>(); input.add(1L); input.add(2L); input.add(3L); final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setRuntimeMode(RuntimeExecutionMode.BATCH); final DataStream<Long> srcOne = env.fromCollection(input); final DataStream<Long> srcTwo = env.fromCollection(input); final BroadcastStream<Long> broadcast = srcTwo.broadcast(utterDescriptor); srcOne.connect(broadcast).process( new BroadcastProcessFunction<Long, Long, Long>() { @Override public void processElement(Long value, ReadOnlyContext ctx, Collector<Long> out) { } @Override public void processBroadcastElement(Long value, Context ctx, Collector<Long> out) { } }); try { env.execute(); fail("Execution should have failed during job graph creation."); } catch (UnsupportedOperationException e) { assertEquals(e.getMessage(), "The Broadcast State Pattern is not support in BATCH execution mode."); } }

Target:
public void testBroadcastBatchTranslationThrowsException() throws Exception { final MapStateDescriptor<Long, Long> utterDescriptor = new MapStateDescriptor<>( "broadcast-state", BasicTypeInfo.LONG_TYPE_INFO, BasicTypeInfo.LONG_TYPE_INFO ); final List<Long> input = new ArrayList<>(); input.add(1L); input.add(2L); input.add(3L); final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); env.setRuntimeMode(RuntimeExecutionMode.BATCH); final DataStream<Long> srcOne = env.fromCollection(input); final DataStream<Long> srcTwo = env.fromCollection(input); final BroadcastStream<Long> broadcast = srcTwo.broadcast(utterDescriptor); srcOne.connect(broadcast).process( new BroadcastProcessFunction<Long, Long, Long>() { @Override public void processElement(Long value, ReadOnlyContext ctx, Collector<Long> out) { } @Override public void processBroadcastElement(Long value, Context ctx, Collector<Long> out) { } }); thrown.expect(UnsupportedOperationException.class); thrown.expectMessage("The Broadcast State Pattern is not support in BATCH execution mode."); env.execute(); }
Source:
protected void executeCommand() { List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); Guid vdsId = getDedicatedHostList().get(0); List<VdsNumaNode> vdsNumaNodes = new ArrayList<>(); if (vdsId != null) { vdsNumaNodes = getVdsNumaNodeDao().getAllVdsNumaNodeByVdsId(vdsId); } int startIndex = 0; List<VmNumaNode> existingNodes = getExistingNumaNodes(); if (!existingNodes.isEmpty()) { startIndex = Collections.max(existingNodes, new NumaNodeComparator()).getIndex() + 1; } List<VdsNumaNode> nodes = new ArrayList<>(); for (VmNumaNode vmNumaNode : vmNumaNodes) { vmNumaNode.setId(Guid.newGuid()); vmNumaNode.setIndex(startIndex++); for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() != null && pair.getSecond().getSecond() != null) { int index = pair.getSecond().getSecond(); if (pair.getSecond().getFirst()) { for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { pair.setFirst(vdsNumaNode.getId()); break; } } } } } nodes.add(vmNumaNode); } getVmNumaNodeDao().massSaveNumaNode(nodes, null, getVm().getId()); setActionReturnValue(nodes.get(0).getId()); setSucceeded(true); }

Target:
protected void executeCommand() { List<VmNumaNode> vmNumaNodes = getParameters().getVmNumaNodeList(); List<VdsNumaNode> vdsNumaNodes = getVdsNumaNodes(); List<VmNumaNode> nodes = new ArrayList<>(); for (VmNumaNode vmNumaNode : vmNumaNodes) { vmNumaNode.setId(Guid.newGuid()); for (Pair<Guid, Pair<Boolean, Integer>> pair : vmNumaNode.getVdsNumaNodeList()) { if (pair.getSecond() != null && pair.getSecond().getSecond() != null) { int index = pair.getSecond().getSecond(); if (pair.getSecond().getFirst()) { for (VdsNumaNode vdsNumaNode : vdsNumaNodes) { if (vdsNumaNode.getIndex() == index) { pair.setFirst(vdsNumaNode.getId()); break; } } } } } nodes.add(vmNumaNode); } getVmNumaNodeDao().massSaveNumaNode(nodes, null, getVm().getId()); setActionReturnValue(nodes.get(0).getId()); setSucceeded(true); }
Source:
public void testHttpPostAsciiText() throws InterruptedException, IOException { final HttpSource httpSource = newHttpSource(); final String stringToPost = "hello"; final FileSink fileSink = newFileSink().binary(true); final String streamName = getRandomStreamName(); final String stream = String.format("%s | %s", httpSource, fileSink); logger.info("Creating Stream: " + stream); stream().create(streamName, stream); logger.info("Posting String: " + stringToPost); httpSource.ensureReady().postData(stringToPost); assertThat(fileSink, eventually(hasContentsThat(equalTo(stringToPost)))); }

Target:
public void testHttpPostAsciiText() throws InterruptedException, IOException { final HttpSource httpSource = newHttpSource(); final String stringToPost = "hello"; final FileSink fileSink = newFileSink().binary(true); final String streamName = getStreamName(); final String stream = String.format("%s | %s", httpSource, fileSink); logger.info("Creating Stream: " + stream); stream().create(streamName, stream); logger.info("Posting String: " + stringToPost); httpSource.ensureReady().postData(stringToPost); assertThat(fileSink, eventually(hasContentsThat(equalTo(stringToPost)))); }
Source:
private int calculateDigits(long time0, long time1) { int numDigits = 5; long timeRange = time1 - time0; if (fTimeProvider.getTimeFormat() == TimeFormat.CALENDAR) { numDigits += 8; if (timeRange < 10000) { numDigits += 10; } else if (timeRange < 10000000) { numDigits += 6; } } else { long sec = time1 / SEC_IN_NS; numDigits = Long.toString(sec).length(); int thousandGroups = (numDigits - 1) / 3; numDigits += thousandGroups; numDigits += 12; if (fTimeProvider.getTimeFormat() == TimeFormat.CYCLES) { numDigits += Messages.Utils_ClockCyclesUnit.length(); } } return numDigits; }

Target:
private int calculateDigits(long time0, long time1) { int numDigits = 5; long timeRange = time1 - time0; TimeFormat timeFormat = fTimeProvider.getTimeFormat(); if (timeFormat == TimeFormat.CALENDAR) { numDigits += 8; if (timeRange < 10000) { numDigits += 10; } else if (timeRange < 10000000) { numDigits += 6; } } else { long sec = time1 / SEC_IN_NS; numDigits = Long.toString(sec).length(); int thousandGroups = (numDigits - 1) / 3; numDigits += thousandGroups; numDigits += 12; if (timeFormat == TimeFormat.CYCLES) { numDigits += Messages.Utils_ClockCyclesUnit.length(); } else if (fTimeProvider.getTimeFormat() == TimeFormat.RELATIVE) { numDigits += 2; } } return numDigits; }
Source:
public int[] transformToIntValuesSV(ProjectionBlock projectionBlock) { int[] selected = getSelectedArray(projectionBlock); if (_intResults == null) { _intResults = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } for (int i = 0; i < _elseThenStatements.size(); i++) { TransformFunction transformFunction = _elseThenStatements.get(i); FieldSpec.DataType dataType = transformFunction.getResultMetadata().getDataType(); int blockNumDocs = projectionBlock.getNumDocs(); int[] evalInts; if (dataType == FieldSpec.DataType.INT) { evalInts = transformFunction.transformToIntValuesSV(projectionBlock); } else { evalInts = new int[blockNumDocs]; switch (dataType) { case LONG: ArrayCopyUtils.copy(transformFunction.transformToLongValuesSV(projectionBlock), evalInts, blockNumDocs); break; case FLOAT: ArrayCopyUtils.copy(transformFunction.transformToFloatValuesSV(projectionBlock), evalInts, blockNumDocs); break; case DOUBLE: ArrayCopyUtils.copy(transformFunction.transformToDoubleValuesSV(projectionBlock), evalInts, blockNumDocs); break; case STRING: ArrayCopyUtils.copy(transformFunction.transformToStringValuesSV(projectionBlock), evalInts, blockNumDocs); break; default: throw new IllegalStateException(String .format("Cannot convert result type [%s] to [INT] for transform function [%s]", dataType, transformFunction)); } } for (int j = 0; j < blockNumDocs; j++) { if (selected[j] == i) { _intResults[j] = evalInts[j]; } } } return _intResults; }

Target:
public int[] transformToIntValuesSV(ProjectionBlock projectionBlock) { if (_resultMetadata.getDataType() != FieldSpec.DataType.INT) { return super.transformToIntValuesSV(projectionBlock); } int[] selected = getSelectedArray(projectionBlock); if (_intResults == null) { _intResults = new int[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } for (int i = 0; i < _elseThenStatements.size(); i++) { TransformFunction transformFunction = _elseThenStatements.get(i); int blockNumDocs = projectionBlock.getNumDocs(); int[] evalInts = transformFunction.transformToIntValuesSV(projectionBlock); for (int j = 0; j < blockNumDocs; j++) { if (selected[j] == i) { _intResults[j] = evalInts[j]; } } } return _intResults; }
Source:
public void finish(){ String shellTitle = new DefaultShell().getText(); new PushButton("Finish").click(); new WaitWhile(new ShellIsActive(shellTitle)); }

Target:
public void finish(){ String shellTitle = new DefaultShell().getText(); new PushButton("Finish").click(); new WaitWhile(new ShellIsAvailable(shellTitle)); }
Source:
private static AbstractBitmap load(String string) { try { BufferedImage bi = ImageIO.read(MojamComponent.class.getResource(string)); if (bi != null) return mojam.screen.load(bi); } catch (IOException e) { e.printStackTrace(); } return null; }

Target:
private static AbstractBitmap load(String string) { try { BufferedImage bi = ImageIO.read(MojamComponent.class.getResource(string)); if (bi != null) { return mojam.screen.load(bi); } } catch (IOException e) { e.printStackTrace(); } return null; }
Source:
public IExecutionDMContext createExecContextFromThreadId(String tid) { assert tid != null; if (tid == null) {return null;} IContainerDMContext parentContainer = fProcesses.createContainerContextFromThreadId(fCommandControl.getContext(), tid); IProcessDMContext processDmc = DMContexts.getAncestorOfType(parentContainer, IProcessDMContext.class); IThreadDMContext threadDmc = fProcesses.createThreadContext(processDmc, tid); return fProcesses.createExecutionContext(parentContainer, threadDmc, tid); }

Target:
private IExecutionDMContext createExecContextFromThreadId(String tid) { assert tid != null; IContainerDMContext parentContainer = fProcesses.createContainerContextFromThreadId(fCommandControl.getContext(), tid); IProcessDMContext processDmc = DMContexts.getAncestorOfType(parentContainer, IProcessDMContext.class); IThreadDMContext threadDmc = fProcesses.createThreadContext(processDmc, tid); return fProcesses.createExecutionContext(parentContainer, threadDmc, tid); }
Source:
protected ExprEval eval(ExprEval x, ExprEval y) { if (x.type() == ExprType.STRING && y.type() == ExprType.STRING) { return ExprEval.of(null); } if (x.type() == ExprType.LONG && y.type() == ExprType.LONG) { return eval(x.asLong(), y.asLong()); } else { return eval(x.asDouble(), y.asDouble()); } }

Target:
protected final ExprEval eval(ExprEval x, ExprEval y) { if (x.type() == ExprType.STRING || y.type() == ExprType.STRING) { return ExprEval.of(null); } if (x.type() == ExprType.LONG && y.type() == ExprType.LONG) { return eval(x.asLong(), y.asLong()); } else { return eval(x.asDouble(), y.asDouble()); } }
Source:
public PercentileDistributionSummary build() { long min = 0L; if (max < Long.MAX_VALUE) { int maxPos = PercentileBuckets.indexOf(max); int num = Math.round(Math.max(100, maxPos) * accuracy); if (num < 4) { num = 4; } int minPos = maxPos - num; min = (minPos > 0) ? PercentileBuckets.get(minPos) : 0L; } final Id id = baseId.withTags(extraTags); return new PercentileDistributionSummary(registry, id, min, max); }

Target:
public PercentileDistributionSummary build() { final Id id = baseId.withTags(extraTags); return new PercentileDistributionSummary(registry, id, min, max); }
Source:
private String getAuthHeader() { String auth = env.getProperty("qstore.admin.username") + ":" + env.getProperty("qstore.admin.password"); byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName("US-ASCII"))); return "Basic " + new String(encodedAuth); }

Target:
private String getAuthHeader() { String auth = env.getProperty("qstore.admin.username") + ":" + env.getProperty("qstore.admin.password"); byte[] encodedAuth = Base64.encodeBase64(auth.getBytes()); return "Basic " + new String(encodedAuth); }
Source:
public WsAgentHealthStateDto checkAgentHealth(@ApiParam(value = "Workspace id") @PathParam("id") String key) throws NotFoundException, ServerException, ForbiddenException, BadRequestException, UnauthorizedException, IOException, ConflictException { validateKey(key); final WorkspaceImpl workspace = workspaceManager.getWorkspace(key); if (WorkspaceStatus.RUNNING != workspace.getStatus()) { return newDto(WsAgentHealthStateDto.class).withWorkspaceStatus(workspace.getStatus()); } final MachineImpl devMachine = workspace.getRuntime().getDevMachine(); if (devMachine == null) { return newDto(WsAgentHealthStateDto.class) .withWorkspaceStatus(workspace.getStatus()) .withCode(NOT_FOUND.getStatusCode()) .withReason("Workspace Agent isn't available if Dev machine isn't RUNNING"); } final WsAgentHealthStateDto check = agentHealthChecker.check(devMachine); check.setWorkspaceStatus(workspace.getStatus()); return check; }

Target:
public WsAgentHealthStateDto checkAgentHealth(@ApiParam(value = "Workspace id") @PathParam("id") String key) throws NotFoundException, ServerException{ final WorkspaceImpl workspace = workspaceManager.getWorkspace(key); if (WorkspaceStatus.RUNNING != workspace.getStatus()) { return newDto(WsAgentHealthStateDto.class).withWorkspaceStatus(workspace.getStatus()); } final MachineImpl devMachine = workspace.getRuntime().getDevMachine(); if (devMachine == null) { return newDto(WsAgentHealthStateDto.class) .withWorkspaceStatus(workspace.getStatus()) .withCode(NOT_FOUND.getStatusCode()) .withReason("Workspace Agent isn't available if Dev machine isn't RUNNING"); } final WsAgentHealthStateDto check = agentHealthChecker.check(devMachine); check.setWorkspaceStatus(workspace.getStatus()); return check; }
Source:
private void initiateChunkDeletesIfAny(final String blobId, final String serviceId) { Callback<GetBlobResultInternal> callback = (GetBlobResultInternal result, Exception exception) -> { if (exception != null) { logger.trace( "Encountered exception when attempting to get chunks of a possibly composite deleted blob " + blobId, exception); } else if (result.getBlobResult != null) { logger.error("Unexpected result returned by background get operation to fetch chunk ids."); } else if (result.storeKeys != null) { List<BackgroundDeleteRequest> deleteRequests = new ArrayList<>(result.storeKeys.size()); for (StoreKey storeKey : result.storeKeys) { logger.trace("Initiating delete of chunk blob: " + storeKey); deleteRequests.add(new BackgroundDeleteRequest(storeKey, serviceId)); } initiateBackgroundDeletes(deleteRequests); } currentBackgroundOperationsCount.decrementAndGet(); }; currentOperationsCount.incrementAndGet(); currentBackgroundOperationsCount.incrementAndGet(); GetBlobOptionsInternal options = new GetBlobOptionsInternal(new GetBlobOptions(GetBlobOptions.OperationType.Data, GetOption.Include_All, null), true); backgroundDeleter.getBlob(blobId, options, callback); }

Target:
private void initiateChunkDeletesIfAny(final String blobId, final String serviceId) { Callback<GetBlobResultInternal> callback = (GetBlobResultInternal result, Exception exception) -> { if (exception != null) { logger.trace("Encountered exception when attempting to get chunks of a possibly composite deleted blob ", blobId, exception); } else if (result.getBlobResult != null) { logger.error("Unexpected result returned by background get operation to fetch chunk ids."); } else if (result.storeKeys != null) { List<BackgroundDeleteRequest> deleteRequests = new ArrayList<>(result.storeKeys.size()); for (StoreKey storeKey : result.storeKeys) { logger.trace("Initiating delete of chunk blob: {}", storeKey); deleteRequests.add(new BackgroundDeleteRequest(storeKey, serviceId)); } initiateBackgroundDeletes(deleteRequests); } currentBackgroundOperationsCount.decrementAndGet(); }; currentOperationsCount.incrementAndGet(); currentBackgroundOperationsCount.incrementAndGet(); GetBlobOptionsInternal options = new GetBlobOptionsInternal(new GetBlobOptions(GetBlobOptions.OperationType.Data, GetOption.Include_All, null), true); backgroundDeleter.getBlob(blobId, options, callback); }
Source:
private BlockBreakHandler onBreak() { return new BlockBreakHandler(true, true) { @Override public void onPlayerBreak(BlockBreakEvent e, ItemStack item, List<ItemStack> drops) { remove(e.getBlock()); } @Override public void onExplode(Block b, List<ItemStack> drops) { remove(b); } @Override public void onAndroidBreak(AndroidMineEvent e) { remove(e.getBlock()); } }; }

Target:
private BlockBreakHandler onBreak() { return new SimpleBlockBreakHandler() { @Override public void onBlockBreak(@Nonnull Block b) { remove(b); } }; }
Source:
public boolean removeAttributeWithoutCheck(PerunSession sess, Member member, Group group, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException { getAttributesManagerImpl().checkNamespace(sess, attribute, NS_MEMBER_GROUP_ATTR); if (getAttributesManagerImpl().isCoreAttribute(sess, attribute)) throw new WrongAttributeAssignmentException(attribute); boolean changed = getAttributesManagerImpl().removeAttribute(sess, member, group, attribute); if (changed) { try { getAttributesManagerImpl().changedAttributeHook(sess, member, group, new Attribute(attribute)); } catch (WrongAttributeValueException | WrongReferenceAttributeValueException ex) { throw new InternalErrorException(ex); } log.info("{} removed this attribute({}) from member in group. Id member = {}, id group = {}",sess.getPerunClient().getId(), attribute.getName(), member.getId(), group.getId()); getPerunBl().getAuditer().log(sess, "{} removed for and {}.", new AttributeDefinition(attribute), member, group); } return changed; }

Target:
public boolean removeAttributeWithoutCheck(PerunSession sess, Member member, Group group, AttributeDefinition attribute) throws InternalErrorException, WrongAttributeAssignmentException { getAttributesManagerImpl().checkNamespace(sess, attribute, NS_MEMBER_GROUP_ATTR); if (getAttributesManagerImpl().isCoreAttribute(sess, attribute)) throw new WrongAttributeAssignmentException(attribute); boolean changed = getAttributesManagerImpl().removeAttribute(sess, member, group, attribute); if (changed) { try { getAttributesManagerImpl().changedAttributeHook(sess, member, group, new Attribute(attribute)); } catch (WrongAttributeValueException | WrongReferenceAttributeValueException ex) { throw new InternalErrorException(ex); } log.info("{} removed attribute from member in group {}.",sess.getLogId(), attribute.getName(), member.getId(), group.getId()); getPerunBl().getAuditer().log(sess, "{} removed for and {}.", new AttributeDefinition(attribute), member, group); } return changed; }
Source:
public static TransactionChannel getDemoTransactionChannel() throws MambuApiException { OrganizationService organizationService = MambuAPIFactory.getOrganizationService(); List<TransactionChannel> transactionChannels = organizationService.getTransactionChannels(); if (transactionChannels == null) { return null; } int randomIndex = (int) Math.round(Math.random() * (transactionChannels.size() - 1)); randomIndex = 1; return transactionChannels.get(randomIndex); }

Target:
public static TransactionChannel getDemoTransactionChannel() throws MambuApiException { OrganizationService organizationService = MambuAPIFactory.getOrganizationService(); List<TransactionChannel> transactionChannels = organizationService.getTransactionChannels(); if (transactionChannels == null) { return null; } int randomIndex = (int) Math.round(Math.random() * (transactionChannels.size() - 1)); return transactionChannels.get(randomIndex); }
Source:
public void test_evaluate_string() { final AtomicReference<String> returnValue = new AtomicReference<>(); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) { } @Override public void completed(ProgressEvent event) { String evalResult = (String) browser.evaluate("return document.getElementById('myid').childNodes[0].nodeValue;"); returnValue.set(evalResult); if (browser_debug) System.out.println("Node value: "+ evalResult); } }); browser.setText("<html><body><p id='myid'>HelloWorld</p></body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if ("HelloWorldz".equals(returnValue.get())) { return; } } fail(name.getMethodName() + " failed. Evaluation did not return a value. Test timed out."); }

Target:
public void test_evaluate_string() { assumeFalse(webkit1SkipMsg(), isWebkit1); final AtomicReference<String> returnValue = new AtomicReference<>(); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) { } @Override public void completed(ProgressEvent event) { String evalResult = (String) browser.evaluate("return document.getElementById('myid').childNodes[0].nodeValue;"); returnValue.set(evalResult); if (browser_debug) System.out.println("Node value: "+ evalResult); } }); browser.setText("<html><body><p id='myid'>HelloWorld</p></body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if ("HelloWorld".equals(returnValue.get())) { return; } } fail("Evaluation did not return a value. Or test timed out."); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { IResourceUIModel selected = getSelectedElement(event, IResourceUIModel.class); if(selected == null) { return null; } String name = null; Deployment deployment = null; IReplicationController rc = null; if(selected instanceof Deployment) { deployment = (Deployment)selected; rc = findReplicationController(deployment); name = deployment.getResource().getName(); } else if(selected.getResource() instanceof IReplicationController) { rc = (IReplicationController)selected.getResource(); name = rc.getName(); Object parent = selected.getParent(); if(parent instanceof Deployment) { deployment = (Deployment)parent; } else if(parent instanceof IProjectAdapter) { deployment = findDeployment((IProjectAdapter)parent, rc); } } if(rc == null) { return null; } String diff = event.getParameter(REPLICA_DIFF); if(!NumberUtils.isNumber(diff)) { IDeploymentConfig dc = null; if(!(rc instanceof IDeploymentConfig)) { String dcName = rc.getAnnotation(OpenShiftAPIAnnotations.DEPLOYMENT_CONFIG_NAME); if(!StringUtils.isNotBlank(dcName)) { dc = findDeploymentConfig(deployment, dcName); } } scaleUsing(event, name, rc, deployment, dc); } else { scaleDeployment(name, rc, rc.getDesiredReplicaCount() + Integer.parseInt(diff), null); } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { IResourceWrapper<?, ?> selected = getSelectedElement(event, IResourceWrapper.class); if(selected == null) { return null; } String name = null; IServiceWrapper deployment = null; IReplicationController rc = null; if(selected instanceof IServiceWrapper) { deployment = (IServiceWrapper)selected; rc = findReplicationController(deployment); name = deployment.getWrapped().getName(); } else if(ResourceKind.REPLICATION_CONTROLLER.equals(selected.getWrapped().getKind()) || ResourceKind.DEPLOYMENT_CONFIG.equals(selected.getWrapped().getKind())) { rc = (IReplicationController)selected.getWrapped(); name = rc.getName(); Object parent = selected.getParent(); if(parent instanceof IServiceWrapper) { deployment = (IServiceWrapper)parent; } else if(parent instanceof IProjectWrapper) { deployment = findDeployment((IProjectWrapper)parent, rc); } } if(rc == null) { return null; } String diff = event.getParameter(REPLICA_DIFF); if(!NumberUtils.isNumber(diff)) { IDeploymentConfig dc = null; if(!(ResourceKind.DEPLOYMENT_CONFIG.equals(rc.getKind()))) { String dcName = rc.getAnnotation(OpenShiftAPIAnnotations.DEPLOYMENT_CONFIG_NAME); if(StringUtils.isNotBlank(dcName)) { dc = findDeploymentConfig(deployment, dcName); } } scaleUsing(event, name, rc, deployment, dc); } else { scaleDeployment(name, rc, rc.getDesiredReplicaCount() + Integer.parseInt(diff), null); } return null; }
Source:
private boolean downloadFiles(String username, String remoteHost, String sourcePath, String destinationPath) { ; ChannelSftp channelSftp = null; try { channelSftp = setupJsch(username, remoteHost); channelSftp.connect(); channelSftp.cd(sourcePath); Vector<ChannelSftp.LsEntry> fileAndFolderList = channelSftp.ls(sourcePath); for (ChannelSftp.LsEntry item : fileAndFolderList) { if (!item.getAttrs().isDir()) { if (!(new File(destinationPath + PATHSEPARATOR + item.getFilename())).exists() || (item.getAttrs().getMTime() > Long .valueOf(new File(destinationPath + PATHSEPARATOR + item.getFilename()).lastModified() / (long) 1000) .intValue())) { new File(destinationPath + PATHSEPARATOR + item.getFilename()); channelSftp.get(sourcePath + PATHSEPARATOR + item.getFilename(), destinationPath + PATHSEPARATOR + item.getFilename()); } } } } catch (JSchException | SftpException ex) { ex.printStackTrace(); return false; } finally { if (channelSftp != null) { channelSftp.disconnect(); } } return true; }

Target:
private boolean downloadFiles(String username, String remoteHost, String sourcePath, String destinationPath) { ChannelSftp channelSftp = null; try { channelSftp = setupJsch(username, remoteHost); channelSftp.connect(); channelSftp.cd(sourcePath); Vector<ChannelSftp.LsEntry> fileAndFolderList = channelSftp.ls(sourcePath); for (ChannelSftp.LsEntry item : fileAndFolderList) { if (!item.getAttrs().isDir()) { if (!(new File(destinationPath + PATHSEPARATOR + item.getFilename())).exists() || (item.getAttrs().getMTime() > Long.valueOf(new File(destinationPath + PATHSEPARATOR + item.getFilename()).lastModified() / (long) 1000).intValue())) { new File(destinationPath + PATHSEPARATOR + item.getFilename()); channelSftp.get(sourcePath + PATHSEPARATOR + item.getFilename(), destinationPath + PATHSEPARATOR + item.getFilename()); } } } } catch (JSchException | SftpException ex) { ex.printStackTrace(); return false; } finally { if (channelSftp != null) { channelSftp.disconnect(); } } return true; }
Source:
protected RenderingContext doPrint(PrintParams params) throws DocumentException { final String layoutName = params.jsonSpec.getString(Constants.JSON_LAYOUT_KEY); Layout layout = params.config.getLayout(layoutName); if (layout == null) { throw new RuntimeException("Unknown layout '" + layoutName + "'"); } Document doc = new Document(layout.getFirstPageSize(null,params.jsonSpec)); PdfWriter writer = PdfWriter.getInstance(doc, params.outputStream); if (!layout.isSupportLegacyReader()) { writer.setFullCompression(); writer.setPdfVersion(PdfWriter.PDF_VERSION_1_5); writer.setCompressionLevel(PdfStream.BEST_COMPRESSION); } RenderingContext context = new RenderingContext(doc, writer, params.config, params.jsonSpec, params.configDir.getPath(), layout, params.headers); layout.render(params.jsonSpec, context); doc.close(); writer.close(); List<PdfReader> readerList = context.getCustomBlocks().getReaders(); if (readerList != null) { for (int i = 0; i < readerList.size(); i++) { try { readerList.get(i).close(); } catch (Exception e) { context.addError(e); } } } return context; }

Target:
protected RenderingContext doPrint(PrintParams params) throws DocumentException { final String layoutName = params.jsonSpec.getString(Constants.JSON_LAYOUT_KEY); Layout layout = params.config.getLayout(layoutName); if (layout == null) { throw new RuntimeException("Unknown layout '" + layoutName + "'"); } Document doc = new Document(layout.getFirstPageSize(null,params.jsonSpec)); PdfWriter writer = PdfWriter.getInstance(doc, params.outputStream); if (!layout.isSupportLegacyReader()) { writer.setFullCompression(); writer.setPdfVersion(PdfWriter.PDF_VERSION_1_5); writer.setCompressionLevel(PdfStream.BEST_COMPRESSION); } RenderingContext context = new RenderingContext(doc, writer, params.config, params.jsonSpec, params.configDir.getPath(), layout, params.headers); layout.render(params.jsonSpec, context); doc.close(); writer.close(); context.getCustomBlocks().closeReaders(); return context; }
Source:
public void receivingAConfirmRequest(final Map<String, String> requestParameters) throws Throwable { ScenarioContext.Current().put("NumberToAddAsNextSequenceNumber", getInteger(requestParameters, "AddNumberToSequenceNumber")); this.oslpDeviceSteps.theDeviceReturnsAStartDeviceResponseOverOSLP("OK"); this.startDeviceTestSteps.receivingAStartDeviceTestRequest(requestParameters); this.startDeviceTestSteps.theStartDeviceAsyncResponseContains(requestParameters); this.oslpDeviceSteps.aStartDeviceOSLPMessageIsSentToDevice( getString(requestParameters, Keys.KEY_DEVICE_IDENTIFICATION, Defaults.DEFAULT_DEVICE_IDENTIFICATION)); final StartDeviceTestAsyncRequest request = new StartDeviceTestAsyncRequest(); final AsyncRequest asyncRequest = new AsyncRequest(); asyncRequest.setDeviceId( getString(requestParameters, Keys.KEY_DEVICE_IDENTIFICATION, Defaults.DEFAULT_DEVICE_IDENTIFICATION)); asyncRequest.setCorrelationUid((String) ScenarioContext.Current().get(Keys.KEY_CORRELATION_UID)); request.setAsyncRequest(asyncRequest); try { ScenarioContext.Current().put(Keys.RESPONSE, this.client.getStartDeviceTestResponse(request)); } catch (final SoapFaultClientException ex) { ScenarioContext.Current().put(Keys.RESPONSE, ex); } }

Target:
public void receivingAConfirmRequest(final Map<String, String> requestParameters) throws Throwable { ScenarioContext.Current().put("NumberToAddAsNextSequenceNumber", getInteger(requestParameters, "AddNumberToSequenceNumber")); }
Source:
public ReconnectingServerStoreProxy(ServerStoreProxy serverStoreProxy, Runnable onReconnect) { this.delegate = serverStoreProxy; this.delegateRef = new AtomicReference<>(serverStoreProxy); this.onReconnect = onReconnect; this.swap = new SwappableProxy(serverStoreProxy.getCacheId()); }

Target:
public ReconnectingServerStoreProxy(ServerStoreProxy serverStoreProxy, Runnable onReconnect) { this.delegateRef = new AtomicReference<>(serverStoreProxy); this.onReconnect = onReconnect; }
Source:
private boolean upgradeNineTen(SQLiteDatabase db) { upgradeXFormAndroidInstallerV1(UPGRADE_RESOURCE_TABLE_NAME, db); upgradeXFormAndroidInstallerV1(RECOVERY_RESOURCE_TABLE_NAME, db); return true; }

Target:
private boolean upgradeNineTen(SQLiteDatabase db) { db.beginTransaction(); try { upgradeToResourcesV10(UPGRADE_RESOURCE_TABLE_NAME, db); upgradeToResourcesV10(RECOVERY_RESOURCE_TABLE_NAME, db); db.setTransactionSuccessful(); } finally { db.endTransaction(); } return true; }
Source:
public void showCourseContainerOutline(Activity activity, EnrolledCoursesResponse courseData, CourseUpgradeResponse courseUpgradeData, String courseComponentId) { showCourseContainerOutline(activity, -1, courseData, courseUpgradeData, courseComponentId, null, false); }

Target:
public void showCourseContainerOutline(Activity activity, EnrolledCoursesResponse courseData, CourseUpgradeResponse courseUpgradeData, String courseComponentId) { Intent courseDetail = CourseOutlineActivity.newIntent(activity, courseData, courseUpgradeData, courseComponentId, null, false); activity.startActivityForResult(courseDetail, -1); }
Source:
private boolean updateReplicaCapacityIfRequired(String partitionName, InstanceConfig instanceConfig, String mountPath, long actualReplicaCapacity) { boolean instanceConfigUpdated = false; Map<String, String> diskInfo = instanceConfig.getRecord().getMapField(mountPath); String currentReplicasStr = diskInfo.get(ClusterMapUtils.REPLICAS_STR); String newReplicaStr = ""; List<String> replicaInfoList = Arrays.asList(currentReplicasStr.split(ClusterMapUtils.REPLICAS_DELIM_STR)); for (String replicaInfo : replicaInfoList) { String[] info = replicaInfo.split(ClusterMapUtils.REPLICAS_STR_SEPARATOR); if (info[0].equals(partitionName)) { long capacityInHelix = Long.valueOf(info[1]); if (capacityInHelix != actualReplicaCapacity) { info[1] = Long.toString(actualReplicaCapacity); } } newReplicaStr += info[0] + ClusterMapUtils.REPLICAS_STR_SEPARATOR + info[1] + ClusterMapUtils.REPLICAS_DELIM_STR; } if (!currentReplicasStr.equals(newReplicaStr)) { diskInfo.put(ClusterMapUtils.REPLICAS_STR, newReplicaStr); instanceConfig.getRecord().setMapField(mountPath, diskInfo); instanceConfigUpdated = true; } return instanceConfigUpdated; }

Target:
private boolean updateReplicaCapacityIfRequired(String partitionName, InstanceConfig instanceConfig, String mountPath, long actualReplicaCapacity) { boolean instanceConfigUpdated = false; Map<String, String> diskInfo = instanceConfig.getRecord().getMapField(mountPath); String currentReplicasStr = diskInfo.get(ClusterMapUtils.REPLICAS_STR); StringBuilder newReplicaStrBuilder = new StringBuilder(); List<String> replicaInfoList = Arrays.asList(currentReplicasStr.split(ClusterMapUtils.REPLICAS_DELIM_STR)); for (String replicaInfo : replicaInfoList) { String[] info = replicaInfo.split(ClusterMapUtils.REPLICAS_STR_SEPARATOR); if (info[0].equals(partitionName)) { long capacityInHelix = Long.valueOf(info[1]); if (capacityInHelix != actualReplicaCapacity) { info[1] = Long.toString(actualReplicaCapacity); } } newReplicaStrBuilder.append(info[0]) .append(ClusterMapUtils.REPLICAS_STR_SEPARATOR) .append(info[1]) .append(ClusterMapUtils.REPLICAS_DELIM_STR); } String newReplicaStr = newReplicaStrBuilder.toString(); if (!currentReplicasStr.equals(newReplicaStr)) { diskInfo.put(ClusterMapUtils.REPLICAS_STR, newReplicaStr); instanceConfig.getRecord().setMapField(mountPath, diskInfo); instanceConfigUpdated = true; } return instanceConfigUpdated; }
Source:
private void parseSecondArgWithoutDash(String arg, boolean passFileExists) { int delimiterIndex = arg.indexOf("="); if ((getConfigAction().equals(ConfigActionType.ACTION_SET) || getConfigAction().equals(ConfigActionType.ACTION_MERGE)) && delimiterIndex == -1 && !passFileExists) { throw new IllegalArgumentException("Argument for set/concat action must be in format of key=value."); } String key = getStringBeforeEqualChar(arg, delimiterIndex); String value = getStringAfterEqualChar(arg, delimiterIndex); if (!key.isEmpty()) { if (!value.isEmpty()) { parseSecondArgWithKeyValue(arg, key, value); } else if ((getConfigAction().equals(ConfigActionType.ACTION_SET) || getConfigAction().equals(ConfigActionType.ACTION_MERGE)) && getKey() == null) { engineConfigMap.setKey(key); engineConfigMap.setValue(value); } else if ((getConfigAction().equals(ConfigActionType.ACTION_GET) || getConfigAction().equals(ConfigActionType.ACTION_HELP)) && getKey() == null) { engineConfigMap.setKey(arg); } else { log.debug("parsing error: illegal argument " + arg + ". Skipping argument."); } } else { log.debug("parsing error: illegal argument " + arg + ", starts with '='. Skipping argument."); } }

Target:
private void parseSecondArgWithoutDash(String arg, boolean passFileExists) { int delimiterIndex = arg.indexOf("="); if (isSetOrMergeAction() && delimiterIndex == -1 && !passFileExists) { throw new IllegalArgumentException("Argument for set/concat action must be in format of key=value."); } String key = getStringBeforeEqualChar(arg, delimiterIndex); String value = getStringAfterEqualChar(arg, delimiterIndex); if (!key.isEmpty()) { if (!value.isEmpty()) { parseSecondArgWithKeyValue(arg, key, value); } else if (isSetOrMergeAction() && getKey() == null) { engineConfigMap.setKey(key); engineConfigMap.setValue(value); } else if ((getConfigAction().equals(ConfigActionType.ACTION_GET) || getConfigAction().equals(ConfigActionType.ACTION_HELP)) && getKey() == null) { engineConfigMap.setKey(arg); } else { log.debug("parsing error: illegal argument " + arg + ". Skipping argument."); } } else { log.debug("parsing error: illegal argument " + arg + ", starts with '='. Skipping argument."); } }
Source:
public Interval getInterval() { return this.interval; }

Target:
public Locatable getInterval() { return this.interval; }
Source:
public String toTableId(String tableName) { Preconditions.checkNotNull(tableName, "table name cannot be null"); String tablesPrefix = clusterName + "/" + TABLE_SEPARATOR + "/"; Preconditions.checkState(tableName.startsWith(tablesPrefix), "'%s' does not start with '%s'", tableName, tablesPrefix); String tableId = tableName.substring(tablesPrefix.length()); Preconditions.checkState(!tableId.isEmpty(), "TableName is blank"); return tableId; }

Target:
public String toTableId(String tableName) { Preconditions.checkNotNull(tableName, "Table name cannot be null"); String tablesPrefix = clusterName + "/" + TABLE_SEPARATOR + "/"; Preconditions.checkState(tableName.startsWith(tablesPrefix), "'%s' does not start with '%s'", tableName, tablesPrefix); String tableId = tableName.substring(tablesPrefix.length()).trim(); Preconditions.checkState(!tableId.isEmpty(), "Table id is blank"); return tableId; }
Source:
protected GCSBatchSink(GCSSinkConfig config) { super(config); this.config = config; if (!this.config.containsMacro("fileSystemProperties") && !this.config.containsMacro("Bucket_Key") && !this.config.containsMacro("Project_Id")) { this.config.fileSystemProperties = updateFileSystemProperties(this.config.fileSystemProperties, this.config.projectId, this.config.jsonKey); } }

Target:
protected GCSBatchSink(GCSSinkConfig config) { super(config); this.config = config; if (!this.config.containsMacro("fileSystemProperties") && !this.config.containsMacro("JsonKeyFile") && !this.config.containsMacro("ProjectId")) { this.config.fileSystemProperties = updateFileSystemProperties(this.config.fileSystemProperties, this.config.projectId, this.config.jsonKey); } }
Source:
public List<Long> getAffinityGroupIdList() { if (affinityGroupNameList != null && affinityGroupIdList != null) { throw new InvalidParameterValueException("affinitygroupids parameter is mutually exclusive with affinitygroupnames parameter"); } if (affinityGroupNameList == null && affinityGroupIdList == null) { throw new InvalidParameterValueException("affinitygroupids parameter or affinitygroupnames parameter must be given"); } if (affinityGroupNameList != null) { List<Long> affinityGroupIds = new ArrayList<Long>(); for (String groupName : affinityGroupNameList) { Long groupId = _responseGenerator.getAffinityGroupId(groupName, getEntityOwnerId()); if (groupId == null) { throw new InvalidParameterValueException("Unable to find group by name " + groupName + " for account " + getEntityOwnerId()); } else { affinityGroupIds.add(groupId); } } return affinityGroupIds; } else { return affinityGroupIdList; } }

Target:
public List<Long> getAffinityGroupIdList() { if (affinityGroupNameList != null) { List<Long> affinityGroupIds = new ArrayList<Long>(); for (String groupName : affinityGroupNameList) { Long groupId = _responseGenerator.getAffinityGroupId(groupName, getEntityOwnerId()); if (groupId == null) { throw new InvalidParameterValueException("Unable to find group by name " + groupName + " for account " + getEntityOwnerId()); } else { affinityGroupIds.add(groupId); } } return affinityGroupIds; } else { return affinityGroupIdList; } }