auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void processLeftData(final MistDataEvent input) { applyStatefulFunction.initialize(); try { final Collection<IN> value = ((WindowData<IN>) input.getValue()).getDataCollection(); for (final IN data : value) { applyStatefulFunction.update(data); } final OUT operationResult = applyStatefulFunction.produceResult(); <START> LOG.log(Level.FINE, "{0} initializes and updates the operator state with input {1} using {2}, and generates {3}", <END> new Object[]{getOperatorIdentifier(), input, applyStatefulFunction, operationResult}); input.setValue(operationResult); outputEmitter.emitData(input); } catch (final ClassCastException e) { throw e; } }</code><technical_language>need log applyStatefulFunction. need log current state of applyStatefulFunction. For this, need interface, getCurrentState()</technical_language>

Target:
public void processLeftData(final MistDataEvent input) { applyStatefulFunction.initialize(); try { final WindowData<IN> windowData = (WindowData<IN>) input.getValue(); final Collection<IN> value = windowData.getDataCollection(); for (final IN data : value) { applyStatefulFunction.update(data); } final OUT operationResult = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} initializes and updates the operator state to {1} with input window {2} " + "which started at {3} and ended at {4}, and generates {5}", new Object[]{getOperatorIdentifier(), applyStatefulFunction.getCurrentState(), input, windowData.getStart(), windowData.getEnd(), operationResult}); input.setValue(operationResult); outputEmitter.emitData(input); } catch (final ClassCastException e) { throw e; } }
Source:
<code>public Map<Path, Set<Integer>> branchChangedLines(String targetBranchName, Path rootBaseDir, Set<Path> changedFiles) { try (Repository repo = buildRepo(rootBaseDir)) { Ref targetRef = resolveTargetRef(targetBranchName, repo); if (targetRef == null) { return null; } Map<Path, Set<Integer>> changedLines = new HashMap<>(); try (Git git = newGit(repo)) { for (Path path : changedFiles) { ChangedLinesComputer computer = new ChangedLinesComputer(); git.diff() .setOutputStream(computer.receiver()) .setOldTree(prepareTreeParser(repo, targetRef)) .setNewTree(prepareNewTree(repo)) .setPathFilter(PathFilter.create(rootBaseDir.relativize(path).toString())) .call() <START> .stream() <END> .filter(diffEntry -> diffEntry.getChangeType() == DiffEntry.ChangeType.ADD || diffEntry.getChangeType() == DiffEntry.ChangeType.MODIFY) .forEach(diffEntry -> changedLines.put(path, computer.changedLines())); } } return changedLines; } catch (IOException | GitAPIException e) { LOG.warn(e.getMessage(), e); } return null; }</code><technical_language>I do this in another instruction clear streaming</technical_language>

Target:
public Map<Path, Set<Integer>> branchChangedLines(String targetBranchName, Path rootBaseDir, Set<Path> changedFiles) { try (Repository repo = buildRepo(rootBaseDir)) { Ref targetRef = resolveTargetRef(targetBranchName, repo); if (targetRef == null) { return null; } Map<Path, Set<Integer>> changedLines = new HashMap<>(); try (Git git = newGit(repo)) { for (Path path : changedFiles) { ChangedLinesComputer computer = new ChangedLinesComputer(); try { List<DiffEntry> diffEntries = git.diff() .setOutputStream(computer.receiver()) .setOldTree(prepareTreeParser(repo, targetRef)) .setPathFilter(PathFilter.create(rootBaseDir.relativize(path).toString())) .call(); diffEntries .stream() .filter(diffEntry -> diffEntry.getChangeType() == DiffEntry.ChangeType.ADD || diffEntry.getChangeType() == DiffEntry.ChangeType.MODIFY) .forEach(diffEntry -> changedLines.put(path, computer.changedLines())); } catch (Exception e) { LOG.warn("Failed to get changed lines from git for file " + path, e); } } } return changedLines; } catch (Exception e) { LOG.warn("Failed to get changed lines from git", e); } return null; }
Source:
<code>public static <T extends AccountingDocument> T buildMockAccountingDocument(Class<T> documentClass) { T document = buildMockDocument(documentClass); Class<? extends SourceAccountingLine> sourceAccountingLineClass = AccountingDocumentClassMappingUtils .getSourceAccountingLineClassByDocumentClass(documentClass); Class<? extends TargetAccountingLine> targetAccountingLineClass = AccountingDocumentClassMappingUtils .getTargetAccountingLineClassByDocumentClass(documentClass); try { PowerMockito.doReturn(sourceAccountingLineClass).when(document, "getSourceAccountingLineClass"); PowerMockito.doReturn(targetAccountingLineClass).when(document, "getTargetAccountingLineClass"); } catch (Exception e) { <START> e.printStackTrace(); <END> throw new RuntimeException(e); } return document; }</code><technical_language>this logged instead of printed</technical_language>

Target:
public static <T extends AccountingDocument> T buildMockAccountingDocument(Class<T> documentClass) { T document = buildMockDocument(documentClass); Class<? extends SourceAccountingLine> sourceAccountingLineClass = AccountingDocumentClassMappingUtils .getSourceAccountingLineClassByDocumentClass(documentClass); Class<? extends TargetAccountingLine> targetAccountingLineClass = AccountingDocumentClassMappingUtils .getTargetAccountingLineClassByDocumentClass(documentClass); try { PowerMockito.doReturn(sourceAccountingLineClass).when(document, "getSourceAccountingLineClass"); PowerMockito.doReturn(targetAccountingLineClass).when(document, "getTargetAccountingLineClass"); } catch (Exception e) { throw new RuntimeException(e); } return document; }
Source:
<code>protected void update(float delta) { List<Sprite> spriteList = ProjectManager.getInstance().getCurrentProject().getSpriteListWithClones(); <START> sprite.look.setZIndex(spriteList.size()); <END> }</code><technical_language>I guess remove + Constants.Z_INDEX_NUMBER_VIRTUAL_LAYERS - 1 here. Z_INDEX_NUMBER_VIRTUAL_LAYERS is currently 1, change in future. This case is spriteList.get(i).look.setZIndex(spriteList.get(i).look.getZIndex() + new z-index is calculated relatively. getZIndex, index considers virtual layers</technical_language>

Target:
protected void update(float delta) { List<Sprite> spriteList = ProjectManager.getInstance().getCurrentProject().getSpriteListWithClones(); sprite.look.setZIndex(spriteList.size() + Constants.Z_INDEX_NUMBER_VIRTUAL_LAYERS - 1); }
Source:
<code>public void tick(Level level) { Random random = TurnSynchronizer.synchedRandom; int width = level.width; int height = level.height; <START> for (int i = 0; i < 1; i++) { <END> double x = (random.nextInt(width - 16) + 8) * Tile.WIDTH + Tile.WIDTH / 2; double y = (random.nextInt(height - 16) + 8) * Tile.HEIGHT + Tile.HEIGHT / 2 - 4; final Tile tile = level.getTile((int) (x / Tile.WIDTH), (int) (y / Tile.HEIGHT)); if (tile instanceof FloorTile) { double r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), Player.class).size() == 0) { r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), SpawnerEntity.class).size() == 0) { r = 32 * 4; if (level.getEntities( new BB(null, x - r, y - r, x + r, y + r), Turret.class).size() == 0) { level.addEntity(new SpawnerEntity(x, y, Team.Neutral, random.nextInt(3))); } } } } } }</code><technical_language>I this in vanilla code for loop for (int i = 0; i < 1; i++) completely unnecessary</technical_language>

Target:
public void tick(Level level) { Random random = TurnSynchronizer.synchedRandom; int width = level.width; int height = level.height; double x = (random.nextInt(width - 16) + 8) * Tile.WIDTH + Tile.WIDTH / 2; double y = (random.nextInt(height - 16) + 8) * Tile.HEIGHT + Tile.HEIGHT / 2 - 4; final Tile tile = level.getTile((int) (x / Tile.WIDTH), (int) (y / Tile.HEIGHT)); if (tile instanceof FloorTile) { double r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), Player.class).size() == 0) { r = 32 * 8; if (level.getEntities(new BB(null, x - r, y - r, x + r, y + r), SpawnerEntity.class).size() == 0) { r = 32 * 4; if (level.getEntities( new BB(null, x - r, y - r, x + r, y + r), Turret.class).size() == 0) { level.addEntity(new SpawnerEntity(x, y, Team.Neutral, random.nextInt(3))); } } } } }
Source:
<code>public static final int hashCode(char[][] matrix) { <START> int hash = 0; <END> for (int i = 0; i < matrix.length; i++) { hash ^= hashCode(matrix[i]); } return hash & 0x7FFFFFFF; }</code><technical_language>If mistaken, this produce hashcode for arrays, char[] in order. Arrays.deepHashcode</technical_language>

Target:
public static final int hashCode(char[][] matrix) { return Arrays.deepHashCode(matrix) & 0x7FFFFFFF; }
Source:
<code>public static BooleanExpression isAnyFieldSetForSelectedEntry(List<Field> fields, StateManager stateManager) { BibEntry entry = stateManager.getSelectedEntries().get(0); return Bindings.createBooleanBinding( <START> () -> !Collections.disjoint(fields, entry.getFields()), <END> entry.getFieldsObservable(), stateManager.getSelectedEntries()); }</code><technical_language>I entry.getFields().stream().anyMatch(fields::contains) is slightly performance wise (as disjoint needs check if *all* elements of fields contained in entry.getFields())</technical_language>

Target:
public static BooleanExpression isAnyFieldSetForSelectedEntry(List<Field> fields, StateManager stateManager) { BibEntry entry = stateManager.getSelectedEntries().get(0); return Bindings.createBooleanBinding( () -> entry.getFields().stream().anyMatch(fields::contains), entry.getFieldsObservable(), stateManager.getSelectedEntries()); }
Source:
<code>private void setUpEditorAccordingToDimensions(ZoomLevel zoomLevel, boolean horizontalScrollbar, boolean verticalScrollBar) { editor.zoom(zoomLevel); SWTBotGefEditPart editPartToMoveForCreatingScroll = editor.getEditPart("CanvasPackageToDrop2", IAbstractDiagramNodeEditPart.class); editor.select(editPartToMoveForCreatingScroll); <START> Point initialLocation = editor.getAbsoluteBounds(editPartToMoveForCreatingScroll).getCenter(); <END> int horizontalShift = 0; int verticalShift = 0; if (horizontalScrollbar) { horizontalShift = 1000; } if (verticalScrollBar) { verticalShift = 1000; } editor.drag(initialLocation, new Point(initialLocation.x + horizontalShift, initialLocation.y + verticalShift)); SWTBotUtils.waitAllUiEvents(); }</code><technical_language>If is scrollbar, this is case a small screen tests environment, absolute bounds is wrong editor.drag work. editor.getBounds instead of editor.getAbsoluteBounds</technical_language>

Target:
private void setUpEditorAccordingToDimensions(ZoomLevel zoomLevel, boolean horizontalScrollbar, boolean verticalScrollBar) { editor.zoom(zoomLevel); SWTBotGefEditPart editPartToMoveForCreatingScroll = editor.getEditPart("CanvasPackageToDrop2", IAbstractDiagramNodeEditPart.class); editor.select(editPartToMoveForCreatingScroll); Point initialLocation = editor.getBounds(editPartToMoveForCreatingScroll).getCenter(); int horizontalShift = 0; int verticalShift = 0; if (horizontalScrollbar) { horizontalShift = 1000; } if (verticalScrollBar) { verticalShift = 1000; } editor.drag(initialLocation, new Point(initialLocation.x + horizontalShift, initialLocation.y + verticalShift)); }
Source:
<code>public Map<String, List<String>> getRequestHeaderMap() { HttpServletRequest request = RequestContext.getCurrentContext().getRequest(); Map<String,List<String>> headers = new HashMap<String,List<String>>(); Enumeration<String> headerNames = request.getHeaderNames(); if(headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); if (name != null && !name.isEmpty()){ Enumeration values = request.getHeaders(name); if (values == null){ continue; } if (headers.get(name) != null){ while (values.hasMoreElements()){ Object value = values.nextElement(); if (value == null){ <START> continue; <END> } headers.get(name).add(String.valueOf(value)); } }else{ List<String> list = new ArrayList<>(); while (values.hasMoreElements()){ Object value = values.nextElement(); if (value == null){ continue; } list.add(String.valueOf(value)); } headers.put(name, list); } } } } return Collections.unmodifiableMap(headers); }</code><technical_language>Instead of continuing, do inverse of if statement add then. code more readable. replace of continues way</technical_language>

Target:
public Map<String, List<String>> getRequestHeaderMap() { HttpServletRequest request = RequestContext.getCurrentContext().getRequest(); Map<String,List<String>> headers = new HashMap<String,List<String>>(); Enumeration<String> headerNames = request.getHeaderNames(); if(headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); if (name != null && !name.isEmpty()){ Enumeration values = request.getHeaders(name); if (values != null){ if (headers.get(name) != null){ while (values.hasMoreElements()){ Object value = values.nextElement(); if (value != null){ headers.get(name).add(String.valueOf(value)); } } }else{ List<String> list = new ArrayList<>(); while (values.hasMoreElements()){ Object value = values.nextElement(); if (value != null){ list.add(String.valueOf(value)); } } headers.put(name, list); } } } } } return Collections.unmodifiableMap(headers); }
Source:
<code>private void releaseAndOfferChannel(final Channel channel, final Promise<Void> promise) { this.ensureInEventLoop(); try { <START> this.acquiredChannels.remove(channel); <END> if (this.offerChannel(channel)) { this.poolHandler.channelReleased(channel); promise.setSuccess(null); } else { final IllegalStateException error = new StacklessIllegalStateException(lenientFormat( "cannot offer channel back to pool because the pool is at capacity (%s)\n %s\n %s", this.maxChannels, this, channel)); this.closeChannelAndFail(channel, error, promise); } } catch (Throwable error) { this.closeChannelAndFail(channel, error, promise); } }</code><technical_language>in scenario is a defensive programming</technical_language>

Target:
private void releaseAndOfferChannel(final Channel channel, final Promise<Void> promise) { this.ensureInEventLoop(); try { if (this.acquiredChannels.remove(channel) == null) { logger.warn( "Unexpected race condition - releaseChannel called twice for the same channel [{} -> {}]", channel.id(), this.remoteAddress()); promise.setSuccess(null); return; } if (this.offerChannel(channel)) { this.poolHandler.channelReleased(channel); promise.setSuccess(null); } else { final IllegalStateException error = new StacklessIllegalStateException(lenientFormat( "cannot offer channel back to pool because the pool is at capacity (%s)\n %s\n %s", this.maxChannels, this, channel)); this.closeChannelAndFail(channel, error, promise); } } catch (Throwable error) { this.closeChannelAndFail(channel, error, promise); } }
Source:
<code>public void usage() { String username = generateUsername(); String password = "password"; UserContext context = PeergosNetworkUtils.ensureSignedUp(username, password, network, crypto); byte[] signedTime = TimeLimited.signNow(context.signer.secret); long quota = network.spaceUsage.getQuota(context.signer.publicKeyHash, signedTime).join(); long usage = network.spaceUsage.getUsage(context.signer.publicKeyHash).join(); <START> Assert.assertTrue(quota > 0); <END> Assert.assertTrue(usage > 0); }</code><technical_language>some meaningful messages accompany tests please</technical_language>

Target:
public void usage() { String username = generateUsername(); String password = "password"; UserContext context = PeergosNetworkUtils.ensureSignedUp(username, password, network, crypto); byte[] signedTime = TimeLimitedClient.signNow(context.signer.secret); long quota = network.spaceUsage.getQuota(context.signer.publicKeyHash, signedTime).join(); long usage = network.spaceUsage.getUsage(context.signer.publicKeyHash).join(); Assert.assertTrue("non zero quota", quota > 0); Assert.assertTrue("non zero space usage", usage > 0); }
Source:
<code>public synchronized void add(byte[] data, int offset, int count) throws IOException { nonNull(data, "buffer"); if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } if (count > maxElementSize) { String message = config.label + ": Adding element that is " + count + " to queue with max" + " element size " + maxElementSize + ". Current queue file size is " + fileLength + "."; if (config.onAddLargeElement == THROW) { throw new IllegalArgumentException(message); <START> } else if (config.onAddLargeElement == LOG) { <END> config.logger.log(message); } else if (config.onAddLargeElement == IGNORE) { } } expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }</code><technical_language>ignore case => build this screen</technical_language>

Target:
public synchronized void add(byte[] data, int offset, int count) throws IOException { nonNull(data, "buffer"); if ((offset | count) < 0 || count > data.length - offset) { throw new IndexOutOfBoundsException(); } queueElementObserver.observeElement( new QueueElementObserver.QueueElementObservation( count, maxElementSize, fileLength - HEADER_LENGTH, true, false)); expandIfNecessary(count); boolean wasEmpty = isEmpty(); int position = wasEmpty ? HEADER_LENGTH : wrapPosition(last.position + Element.HEADER_LENGTH + last.length); Element newLast = new Element(position, count); writeInt(buffer, 0, count); ringWrite(newLast.position, buffer, 0, Element.HEADER_LENGTH); ringWrite(newLast.position + Element.HEADER_LENGTH, data, offset, count); int firstPosition = wasEmpty ? newLast.position : first.position; writeHeader(fileLength, elementCount + 1, firstPosition, newLast.position); last = newLast; elementCount++; if (wasEmpty) first = last; }
Source:
<code><START> @Test public void withRunCommand() { <END> story.addStep(new Statement() { @Override public void evaluate() throws Throwable { assumeDocker(); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( " semaphore 'wait'\n" + " docker.image('maven:3.3.9-jdk-8').withRun(\"--entrypoint mvn\", \"-version\") {c ->\n" + " sh \"docker logs ${c.id}\"" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SemaphoreStep.success("wait/1", null); WorkflowJob p = story.j.jenkins.getItemByFullName("prj", WorkflowJob.class); WorkflowRun b = p.getLastBuild(); story.j.assertLogContains("Maven home: /usr/share/maven", story.j.assertBuildStatusSuccess(story.j.waitForCompletion(b))); story.j.assertLogContains("Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre", b); DockerClient client = new DockerClient(new Launcher.LocalLauncher(StreamTaskListener.NULL), null, null); String httpdIID = client.inspect(new EnvVars(), "maven:3.3.9-jdk-8", ".Id"); Fingerprint f = DockerFingerprints.of(httpdIID); assertNotNull(f); DockerRunFingerprintFacet facet = f.getFacet(DockerRunFingerprintFacet.class); assertNotNull(facet); assertEquals(1, facet.records.size()); assertNotNull(facet.records.get(0).getContainerName()); assertEquals(Fingerprint.RangeSet.fromString("1", false), facet.getRangeSet(p)); assertEquals(Collections.singleton("maven"), DockerImageExtractor.getDockerImagesUsedByJobFromAll(p)); } }); }</code><technical_language>need a test for withRun args command</technical_language>

Target:
@Test public void withRunCommand() { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { assumeDocker(); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "prj"); p.setDefinition(new CpsFlowDefinition( " docker.image('maven:3.3.9-jdk-8').withRun(\"--entrypoint mvn\", \"-version\") {c ->\n" + " sh \"docker logs ${c.id}\"" + "}", true)); story.j.assertBuildStatusSuccess(p.scheduleBuild2(0)); DockerClient client = new DockerClient(new Launcher.LocalLauncher(StreamTaskListener.NULL), null, null); String mavenIID = client.inspect(new EnvVars(), "maven:3.3.9-jdk-8", ".Id"); Fingerprint f = DockerFingerprints.of(mavenIID); assertNotNull(f); DockerRunFingerprintFacet facet = f.getFacet(DockerRunFingerprintFacet.class); assertNotNull(facet); } }); }
Source:
<code>public String ensureIndexed(List<FieldSort> fieldNames) throws QueryException { List<Index> indexes = this.listIndexes(); Collections.sort(fieldNames); <START> for(Index index: indexes){ <END> Collections.sort(index.fieldNames); if (fieldNames.equals(filterMeta(index.fieldNames))){ return index.indexName; } } return this.ensureIndexed(fieldNames, null); }</code><technical_language>account for indexType tokenize options Index. I if easier select existed index(es) a SQL query</technical_language>

Target:
public String ensureIndexed(List<FieldSort> fieldNames) throws QueryException { return this.ensureIndexed(fieldNames, null); }
Source:
<code>private boolean isRemoveLeaseNeeded(Guid srcLeaseDomainId, Guid dstLeaseDomainId) { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return (srcLeaseDomainId != null && dstLeaseDomainId != null && !srcLeaseDomainId.equals(dstLeaseDomainId)) || (srcLeaseDomainId == null && dstLeaseDomainId != null); } <START> else if <END> (getParameters().getSnapshotAction() == SnapshotActionEnum.COMMIT) { return (srcLeaseDomainId != null && dstLeaseDomainId != null && !srcLeaseDomainId.equals(dstLeaseDomainId)) || (srcLeaseDomainId != null && dstLeaseDomainId == null); } return false; }</code><technical_language>need for 'else' a return in previous 'if'</technical_language>

Target:
private boolean isRemoveLeaseNeeded(Guid srcLeaseDomainId, Guid dstLeaseDomainId) { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return isLeaseStorageDomainsEquals(srcLeaseDomainId, dstLeaseDomainId) || (srcLeaseDomainId == null && dstLeaseDomainId != null); } else if (getParameters().getSnapshotAction() == SnapshotActionEnum.COMMIT) { return isLeaseStorageDomainsEquals(srcLeaseDomainId, dstLeaseDomainId) || (srcLeaseDomainId != null && dstLeaseDomainId == null); } return false; }
Source:
<code>public void onReceive(Context context, Intent intent) { boolean interceptedIntent = false; if("com.google.android.c2dm.intent.RECEIVE".equals(intent.getAction())) { Bundle extras = intent.getExtras(); if (extras != null) { <START> Object rawId = extras.get("_p"); <END> String msgId = (rawId != null) ? rawId.toString() : null; if (!SwrveHelper.isNullOrEmpty(msgId)) { interceptedIntent = true; ComponentName comp = new ComponentName(context.getPackageName(), "com.swrve.sdk.gcm.SwrveGcmIntentService"); intent = intent.setComponent(comp); context.startService(intent); } } } if (!interceptedIntent) { super.onReceive(context, intent); } }</code><technical_language>put "_p" a constant. "com.google.android.c2dm.intent.RECEIVE". suggest creating a new GCMConstants file</technical_language>

Target:
public void onReceive(Context context, Intent intent) { boolean interceptedIntent = false; if("com.google.android.c2dm.intent.RECEIVE".equals(intent.getAction())) { Bundle extras = intent.getExtras(); if (extras != null) { Object rawId = extras.get(SwrveGcmConstants.SWRVE_TRACKING_KEY); String msgId = (rawId != null) ? rawId.toString() : null; if (!SwrveHelper.isNullOrEmpty(msgId)) { SwrveLogger.d("Received Swrve push, starting " + SwrveGcmConstants.SWRVE_DEFAULT_INTENT_SERVICE + " instead"); interceptedIntent = true; ComponentName comp = new ComponentName(context.getPackageName(), SwrveGcmConstants.SWRVE_DEFAULT_INTENT_SERVICE); intent = intent.setComponent(comp); context.startService(intent); } } } if (!interceptedIntent) { super.onReceive(context, intent); } }
Source:
<code>public String getHashString(RowMap r, List<String> partitionColumns, String partitionKeyFallback) { String t = r.getTable(); <START> if ( t == null && partitionKeyFallback.equals("database") ) <END> return r.getDatabase(); else return r.getTable(); }</code><technical_language>"database".equals(partitionKeyFallback) in case partitionKeyFallback is null</technical_language>

Target:
public String getHashString(RowMap r, List<String> partitionColumns, String partitionKeyFallback) { String t = r.getTable(); if ( t == null && "database".equals(partitionKeyFallback) ) return r.getDatabase(); else return t; }
Source:
<code>public boolean shouldVdsBeFenced() { <START> boolean result = false; <END> switch (vds.getStatus()) { case Down: case InstallFailed: case Maintenance: case NonOperational: case NonResponsive: result = true; break; default: break; } return result; }</code><technical_language>If want remove null validation constructor, added</technical_language>

Target:
public boolean shouldVdsBeFenced() { boolean result = false; if (vds == null) { return false; } switch (vds.getStatus()) { case Down: case InstallFailed: case Maintenance: case NonOperational: case NonResponsive: result = true; break; default: break; } return result; }
Source:
<code><START> private String getAttribute(PlexusConfiguration dom, String attrName) throws PlexusConfigurationException { <END> String attr = dom.getAttribute(attrName); if (attr == null) { return null; } attr = attr.trim(); if (attr.length() == 0) { return null; } return attr; }</code><technical_language>This Exception is thrown. while developing, a change required throws clause, need in proposed patch. I expected reviewed change proposing here, removed this change</technical_language>

Target:
private String getAttribute(PlexusConfiguration dom, String attrName) { String attr = dom.getAttribute(attrName); if (attr == null) { return null; } attr = attr.trim(); if (attr.length() == 0) { return null; } return attr; }
Source:
<code>public String getCategoryID() { return <START> "org.eclipse.papyrus.sysml14.diagram.parametric.dnd.ParameterDropStrategy"; <END> }</code><technical_language>Category id Strategy id</technical_language>

Target:
public String getCategoryID() { return "org.eclipse.papyrus.sysml14.diagram.parametric"; }
Source:
<code>private String format(String message) { SocketAddress local = context.channel().localAddress(); SocketAddress remote = context.channel().remoteAddress(); <START> String localhost ; <END> if (local != null && local instanceof InetSocketAddress) { InetSocketAddress inetlocal = (InetSocketAddress)local; localhost = inetlocal.getAddress().getHostAddress() + ":" + inetlocal.getPort(); } else { localhost = "undefined"; } String remotehost; if (remote != null && remote instanceof InetSocketAddress) { InetSocketAddress inetremote = (InetSocketAddress)local; remotehost = inetremote.getAddress().getHostAddress() + ":" + inetremote.getPort(); } else { remotehost = "undefined"; } return "[local: " + localhost + ", remote: " + remotehost + "] " + message; }</code><technical_language>NIT: unnecessary space ;</technical_language>

Target:
private String format(String message) { SocketAddress local = context.channel().localAddress(); SocketAddress remote = context.channel().remoteAddress(); String localhost = addressToString(local); String remotehost = addressToString(remote); return "[local: " + localhost + ", remote: " + remotehost + "] " + message; }
Source:
<code>public void testHttpUriVariables() { Message<?> message = MessageBuilder.withPayload("<spring/>") .setHeader("x", "integration") .setHeader("param", "test1 & test2") .build(); try { this.inputHttp.send(message); } catch (MessageHandlingException e) { Class<?> causeType = e.getCause().getClass(); <START> assertTrue(WebServiceIOException.class.equals(causeType) END> || SoapMessageCreationException.class.equals(causeType)); } assertEquals("<LINK_0>", this.interceptor.getLastUri().toString()); }</code><technical_language>This test is failing for - e is a WebServiceTransportException. Also, console is full of messages this... Error! A startup class in smack-config.xml loaded: org.jivesoftware.smackx.ServiceDiscoveryManager Error! A startup class in smack-config.xml loaded: org.jivesoftware.smackx.XHTMLManager Error! A startup class in smack-config.xml loaded: org.jivesoftware.smackx.muc.MultiUserChat Error! A startup class in smack-config.xml loaded: org.jivesoftware.smackx.bytestreams.ibb.InBandBytestreamManager ..</technical_language>

Target:
public void testHttpUriVariables() { Message<?> message = MessageBuilder.withPayload("<spring/>") .setHeader("x", "integration") .setHeader("param", "test1 & test2") .build(); try { this.inputHttp.send(message); } catch (MessageHandlingException e) { Class<?> causeType = e.getCause().getClass(); assertTrue(WebServiceIOException.class.equals(causeType) || SoapMessageCreationException.class.equals(causeType)); } assertEquals("<LINK_1>", this.interceptor.getLastUri().toString()); }
Source:
<code>private boolean processWebSocket(final Exchange camelExchange, final AsyncCallback camelCallback) { final Message in = camelExchange.getIn(); try { Object message = in.getBody(); if (!(message instanceof String || message instanceof byte[] || message instanceof Reader || message instanceof InputStream)) { message = in.getBody(String.class); } if (message != null) { final int timeout = endpoint.getSendTimeout(); if (isSendToAll(in)) { return webSocketHandler.send(peer -> true, message, timeout, camelExchange, camelCallback); } final List<String> connectionKeys = in.getHeader(UndertowConstants.CONNECTION_KEY_LIST, List.class); if (connectionKeys != null) { return webSocketHandler.send( peer -> connectionKeys.contains(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } final String connectionKey = in.getHeader(UndertowConstants.CONNECTION_KEY, String.class); if (connectionKey != null) { return webSocketHandler.send( peer -> connectionKey.equals(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } throw new IllegalStateException( String.format("Cannot process message which has none of the headers %s, %s or %s set: %s", UndertowConstants.SEND_TO_ALL, UndertowConstants.CONNECTION_KEY_LIST, UndertowConstants.CONNECTION_KEY, in)); } else { camelCallback.done(true); return true; } <START> } catch (IOException e) { <END> camelExchange.setException(e); camelCallback.done(true); return true; } }</code><technical_language>Catch kinds of exceptions, Exception Throwable</technical_language>

Target:
private boolean processWebSocket(final Exchange camelExchange, final AsyncCallback camelCallback) { final Message in = camelExchange.getIn(); try { Object message = in.getBody(); if (!(message instanceof String || message instanceof byte[] || message instanceof Reader || message instanceof InputStream)) { message = in.getBody(String.class); } if (message != null) { final int timeout = endpoint.getSendTimeout(); if (isSendToAll(in)) { return webSocketHandler.send(peer -> true, message, timeout, camelExchange, camelCallback); } final List<String> connectionKeys = in.getHeader(UndertowConstants.CONNECTION_KEY_LIST, List.class); if (connectionKeys != null) { return webSocketHandler.send( peer -> connectionKeys.contains(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } final String connectionKey = in.getHeader(UndertowConstants.CONNECTION_KEY, String.class); if (connectionKey != null) { return webSocketHandler.send( peer -> connectionKey.equals(peer.getAttribute(UndertowConstants.CONNECTION_KEY)), message, timeout, camelExchange, camelCallback); } throw new IllegalStateException( String.format("Cannot process message which has none of the headers %s, %s or %s set: %s", UndertowConstants.SEND_TO_ALL, UndertowConstants.CONNECTION_KEY_LIST, UndertowConstants.CONNECTION_KEY, in)); } else { camelCallback.done(true); return true; } } catch (Exception e) { camelExchange.setException(e); camelCallback.done(true); return true; } }
Source:
<code>private void waitPeriodBeforeRetry() { try { Thread.sleep(waitBetweenDeploymentFailures); <START> } catch (InterruptedException e1) { <END> } }</code><technical_language>Thread.currentThread().interrupt();</technical_language>

Target:
private void waitPeriodBeforeRetry() { try { Thread.sleep(waitBetweenDeploymentFailures); } catch (InterruptedException e1) { Thread.currentThread().interrupt(); } }
Source:
<code>private static void writeVersionStatement(XMLStreamWriter xmlw, DatasetVersionDTO datasetVersionDTO) throws XMLStreamException{ xmlw.writeStartElement("verStmt"); <START> writeAttribute(xmlw,"source","producer"); <END> xmlw.writeStartElement("version"); writeAttribute(xmlw,"date", datasetVersionDTO.getReleaseTime().substring(0, 10)); writeAttribute(xmlw,"type", datasetVersionDTO.getVersionState().toString()); xmlw.writeCharacters(datasetVersionDTO.getVersionNumber().toString()); xmlw.writeEndElement(); xmlw.writeEndElement(); }</code><technical_language>string "DVN_3_0" appears in if (!SOURCE_DVN_3_0.equals(xmlr.getAttributeValue(null, "source"))) { in ImportDDIServiceBean. exact match I *think* this break dataset import DDI I thought mention it</technical_language>

Target:
private static void writeVersionStatement(XMLStreamWriter xmlw, DatasetVersionDTO datasetVersionDTO) throws XMLStreamException{ xmlw.writeStartElement("verStmt"); writeAttribute(xmlw,"source","archive"); xmlw.writeStartElement("version"); writeAttribute(xmlw,"date", datasetVersionDTO.getReleaseTime().substring(0, 10)); writeAttribute(xmlw,"type", datasetVersionDTO.getVersionState().toString()); xmlw.writeCharacters(datasetVersionDTO.getVersionNumber().toString()); xmlw.writeEndElement(); xmlw.writeEndElement(); }
Source:
<code>public void doesNotAcceptEmptySchemaWhenNotMSSQL() throws SQLException { <START> try (Connection conn = getConnection("ignoreCatalogs;IGNORE_CATALOGS=TRUE;init=drop all objects\\;create schema dbo\\;set schema dbo\\;")) { <END> try (Statement stat = conn.createStatement()) { stat.execute("create table catalog1.dbo.test(id int primary key, name varchar(255))"); assertThrows(ErrorCode.SYNTAX_ERROR_2,stat,"comment on table catalog1..test is 'table comment3'"); assertThrows(ErrorCode.SYNTAX_ERROR_2,stat,"create table catalog1..test2(id int primary key, name varchar(255))"); stat.execute("comment on table catalog1.dbo.test is 'table comment1'"); stat.execute("insert into test values(1, 'Hello')"); stat.execute("insert into cat.dbo.test values(2, 'Hello2')"); assertThrows(ErrorCode.SYNTAX_ERROR_2,stat,"comment on column catalog1...test.id is 'id comment1'"); assertThrows(ErrorCode.SYNTAX_ERROR_2,stat,"comment on column catalog1..test..id is 'id comment1'"); assertThrows(ErrorCode.SYNTAX_ERROR_2,stat,"comment on column ..test..id is 'id comment1'"); } } finally { deleteDb("ignoreCatalogs"); } }</code><technical_language>remove INIT parameters URLs execute commands in normal way. improve readability</technical_language>

Target:
public void doesNotAcceptEmptySchemaWhenNotMSSQL() throws SQLException { try (Connection conn = getConnection("ignoreCatalogs;IGNORE_CATALOGS=TRUE")) { try (Statement stat = conn.createStatement()) { prepareDbAndSetDefaultSchema(stat); stat.execute("set schema dbo"); stat.execute("create table catalog1.dbo.test(id int primary key, name varchar(255))"); assertThrows(ErrorCode.SYNTAX_ERROR_2, stat, "comment on table catalog1..test is 'table comment3'"); assertThrows(ErrorCode.SYNTAX_ERROR_2, stat, "create table catalog1..test2(id int primary key, " + "name varchar(255))"); stat.execute("comment on table catalog1.dbo.test is 'table comment1'"); stat.execute("insert into test values(1, 'Hello')"); stat.execute("insert into cat.dbo.test values(2, 'Hello2')"); assertThrows(ErrorCode.SYNTAX_ERROR_2, stat, "comment on column catalog1...test.id is 'id comment1'"); assertThrows(ErrorCode.SYNTAX_ERROR_2, stat, "comment on column catalog1..test..id is 'id comment1'"); assertThrows(ErrorCode.SYNTAX_ERROR_2, stat, "comment on column ..test..id is 'id comment1'"); } } finally { deleteDb("ignoreCatalogs"); } }
Source:
<code>protected void build(VmBase vm, UnitVmModel model) { model.getMemSize().setEntity(vm.getMemSizeMb()); if (supported(ConfigurationValues.IoThreadsSupported, model)) { model.getIoThreadsEnabled().setEntity(vm.getNumOfIoThreads() != 0); model.getNumOfIoThreads().setEntity(vm.getNumOfIoThreads()); } model.getMinAllocatedMemory().setEntity(vm.getMinAllocatedMem()); model.getUsbPolicy().setSelectedItem(vm.getUsbPolicy()); model.getNumOfMonitors().setSelectedItem(vm.getNumOfMonitors()); model.getIsSingleQxlEnabled().setEntity(vm.getSingleQxlPci()); model.setBootSequence(vm.getDefaultBootSequence()); model.getTotalCPUCores().setEntity(Integer.toString(vm.getNumOfCpus())); model.getNumOfSockets().setSelectedItem(vm.getNumOfSockets()); model.getIsSmartcardEnabled().setEntity(vm.isSmartcardEnabled()); model.setSelectedMigrationDowntime(vm.getMigrationDowntime()); model.getEmulatedMachine().setSelectedItem(vm.getCustomEmulatedMachine()); model.getCustomCpu().setSelectedItem(vm.getCustomCpuName()); <START> model.getCompatibilityVersion().setSelectedItem(vm.getCompatibilityVersion()); <END> }</code><technical_language>same, in CoreVmBaseToUnitBuilder</technical_language>

Target:
protected void build(VmBase vm, UnitVmModel model) { model.getMemSize().setEntity(vm.getMemSizeMb()); if (supported(ConfigurationValues.IoThreadsSupported, model)) { model.getIoThreadsEnabled().setEntity(vm.getNumOfIoThreads() != 0); model.getNumOfIoThreads().setEntity(vm.getNumOfIoThreads()); } model.getMinAllocatedMemory().setEntity(vm.getMinAllocatedMem()); model.getUsbPolicy().setSelectedItem(vm.getUsbPolicy()); model.getNumOfMonitors().setSelectedItem(vm.getNumOfMonitors()); model.getIsSingleQxlEnabled().setEntity(vm.getSingleQxlPci()); model.setBootSequence(vm.getDefaultBootSequence()); model.getTotalCPUCores().setEntity(Integer.toString(vm.getNumOfCpus())); model.getNumOfSockets().setSelectedItem(vm.getNumOfSockets()); model.getIsSmartcardEnabled().setEntity(vm.isSmartcardEnabled()); model.setSelectedMigrationDowntime(vm.getMigrationDowntime()); model.getEmulatedMachine().setSelectedItem(vm.getCustomEmulatedMachine()); model.getCustomCpu().setSelectedItem(vm.getCustomCpuName()); }
Source:
<code>public static ProcessMetricGroup instantiateProcessMetricGroup( final MetricRegistry metricRegistry, final String hostname, final Optional<Time> systemResourceProbeInterval) { final ProcessMetricGroup processMetricGroup = ProcessMetricGroup.create(metricRegistry, hostname); <START> instantiateStatusMetricGroup(processMetricGroup); <END> systemResourceProbeInterval.ifPresent(interval -> instantiateSystemMetrics(processMetricGroup, interval)); return processMetricGroup; }</code><technical_language>I this kind of commits called [hotfix]</technical_language>

Target:
public static ProcessMetricGroup instantiateProcessMetricGroup( final MetricRegistry metricRegistry, final String hostname, final Optional<Time> systemResourceProbeInterval) { final ProcessMetricGroup processMetricGroup = ProcessMetricGroup.create(metricRegistry, hostname); createAndInitializeStatusMetricGroup(processMetricGroup); systemResourceProbeInterval.ifPresent(interval -> instantiateSystemMetrics(processMetricGroup, interval)); return processMetricGroup; }
Source:
<code>private boolean redefineVmCheckpoints() { VDSReturnValue vdsRetVal; try { List<VmCheckpoint> checkpoints = vmCheckpointDao.getAllForVm(getVmId()); if (checkpoints.isEmpty()) { log.info("No previous VM checkpoints found for VM '{}', skip redefine VM checkpoints", getVmId()); return true; } for (VmCheckpoint checkpoint : checkpoints) { vdsRetVal = runVdsCommand(VDSCommandType.RedefineVmCheckpoints, new VmCheckpointsVDSParameters(getVdsId(), getVmId(), List.of(checkpoint))); VmCheckpointInfo <START> VmCheckpointInfo <END> = (VmCheckpointInfo) vdsRetVal.getReturnValue(); if (!vdsRetVal.getSucceeded() || VmCheckpointInfo.getError() != null) { EngineException engineException = new EngineException(); engineException.setVdsError(vdsRetVal.getVdsError()); engineException.setVdsReturnValue(vdsRetVal); throw engineException; } } return true; } catch (EngineException e) { log.error("Failed to execute VM.redefineCheckpoints: {}", e); return false; } }</code><technical_language>"v" - lowercase</technical_language>

Target:
private boolean redefineVmCheckpoints() { VDSReturnValue vdsRetVal; try { List<VmCheckpoint> checkpoints = vmCheckpointDao.getAllForVm(getVmId()); if (checkpoints.isEmpty()) { log.info("No previous VM checkpoints found for VM '{}', skip redefine VM checkpoints", getVmId()); return true; } for (VmCheckpoint checkpoint : checkpoints) { vdsRetVal = runVdsCommand(VDSCommandType.RedefineVmCheckpoints, new VmCheckpointsVDSParameters(getVdsId(), getVmId(), List.of(checkpoint))); VmCheckpointInfo vmCheckpointInfo = (VmCheckpointInfo) vdsRetVal.getReturnValue(); if (!vdsRetVal.getSucceeded() || vmCheckpointInfo.getError() != null) { EngineException engineException = new EngineException(); engineException.setVdsError(vdsRetVal.getVdsError()); engineException.setVdsReturnValue(vdsRetVal); throw engineException; } } return true; } catch (EngineException e) { log.error("Failed to execute VM.redefineCheckpoints: {}", e); return false; } }
Source:
<code>protected boolean storeManagedBlob(BlobHolder blobHolder) { Blob blob = blobHolder.getBlob(); <START> if (!(blob instanceof ManagedBlob) || blobHolder.getBlobs().size() > 1) { <END> return false; } ManagedBlob mBlob = (ManagedBlob) blob; BlobProvider blobProvider = Framework.getService(BlobManager.class).getBlobProvider(mBlob); if (blobProvider.canConvert(mBlob, destinationMimeType)) { this.managedBlob = mBlob; return true; } return false; }</code><technical_language>a precaution, please check add || !(blob instanceof Serializable) able serialize ConversionWork</technical_language>

Target:
protected boolean storeManagedBlob(BlobHolder blobHolder) { Blob blob = blobHolder.getBlob(); if (!(blob instanceof ManagedBlob) || !(blob instanceof Serializable) || blobHolder.getBlobs().size() > 1) { return false; } ManagedBlob mBlob = (ManagedBlob) blob; BlobProvider blobProvider = Framework.getService(BlobManager.class).getBlobProvider(mBlob); if (blobProvider.canConvert(mBlob, destinationMimeType)) { this.managedBlob = mBlob; return true; } return false; }
Source:
<code>public void stop() { if (isLeader()) { zkLeaderElector.resignLeadership(); } <START> zkUtils.deleteProcessorNode(processorId); <END> if (zkUtils != null) { zkUtils.close(); } }</code><technical_language>this done finally is executed? exception resignLeadership trigger delete</technical_language>

Target:
public void stop() { try { if (isLeader()) { zkLeaderElector.resignLeadership(); } } finally { zkUtils.deleteProcessorNode(processorId); zkUtils.close(); } }
Source:
<code>private void archiveConversation(Conversation conversation, final boolean maySyncronizeWithBookmarks) { getNotificationService().clear(conversation); conversation.setStatus(Conversation.STATUS_ARCHIVED); conversation.setNextMessage(null); synchronized (this.conversations) { getMessageArchiveService().kill(conversation); if (conversation.getMode() == Conversation.MODE_MULTI) { if (conversation.getAccount().getStatus() == Account.State.ONLINE) { Bookmark bookmark = conversation.getBookmark(); if (maySyncronizeWithBookmarks && bookmark != null && synchronizeWithBookmarks()) { if (conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) { Account account = bookmark.getAccount(); bookmark.setConversation(null); account.getBookmarks().remove(bookmark); pushBookmarks(account); } else { <START> if (bookmark.autojoin()) { <END> bookmark.setAutojoin(false); pushBookmarks(bookmark.getAccount()); } } } } leaveMuc(conversation); } else { if (conversation.getContact().getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { stopPresenceUpdatesTo(conversation.getContact()); } } updateConversation(conversation); this.conversations.remove(conversation); updateConversationUi(); } }</code><technical_language>This else if save indentation level</technical_language>

Target:
private void archiveConversation(Conversation conversation, final boolean maySyncronizeWithBookmarks) { getNotificationService().clear(conversation); conversation.setStatus(Conversation.STATUS_ARCHIVED); conversation.setNextMessage(null); synchronized (this.conversations) { getMessageArchiveService().kill(conversation); if (conversation.getMode() == Conversation.MODE_MULTI) { if (conversation.getAccount().getStatus() == Account.State.ONLINE) { Bookmark bookmark = conversation.getBookmark(); if (maySyncronizeWithBookmarks && bookmark != null && synchronizeWithBookmarks()) { if (conversation.getMucOptions().getError() == MucOptions.Error.DESTROYED) { Account account = bookmark.getAccount(); bookmark.setConversation(null); account.getBookmarks().remove(bookmark); pushBookmarks(account); } else if (bookmark.autojoin()) { bookmark.setAutojoin(false); pushBookmarks(bookmark.getAccount()); } } } leaveMuc(conversation); } else { if (conversation.getContact().getOption(Contact.Options.PENDING_SUBSCRIPTION_REQUEST)) { stopPresenceUpdatesTo(conversation.getContact()); } } updateConversation(conversation); this.conversations.remove(conversation); updateConversationUi(); } }
Source:
<code>protected TdLoadOperator(OperatorContext context) { super(context, env, systemConfig); params = request.getConfig().mergeDefault( request.getConfig().getNestedOrGetEmpty("td")); config = params.getOptionalNested("config"); name = params.getOptional("name", String.class); command = params.getOptional("_command", String.class); if (config.isPresent() && name.isPresent()) { throw new ConfigException("The parameters config and name cannot both be set"); } long numExistParams = Stream.of(command, name, config).filter(Optional::isPresent).count(); if ( numExistParams > 1) { throw new ConfigException("Only the command or one of the config and name params may be set"); } <START> else if (numExistParams <= 0) { <END> throw new ConfigException("No parameter is set"); } if (command.isPresent()) { if (command.get().endsWith(".yml") || command.get().endsWith(".yaml")) { this.embulkConfig = Optional.of(compileEmbulkConfig(params, command.get())); this.sessionName = Optional.absent(); } else { this.embulkConfig = Optional.absent(); this.sessionName = Optional.of(command.get()); } } else if (name.isPresent()) { this.embulkConfig = Optional.absent(); this.sessionName = name; } else if (config.isPresent()) { this.embulkConfig = Optional.of(config.get().getInternalObjectNode()); this.sessionName = Optional.absent(); } else { throw new ConfigException("Unexpected config error"); } }</code><technical_language>Do need check negative number? Simply is good enough check num is zero not</technical_language>

Target:
protected TdLoadOperator(OperatorContext context) { super(context, env, systemConfig); params = request.getConfig().mergeDefault( request.getConfig().getNestedOrGetEmpty("td")); config = params.getOptionalNested("config"); name = params.getOptional("name", String.class); command = params.getOptional("_command", String.class); if (config.isPresent() && name.isPresent()) { throw new ConfigException("The parameters config and name cannot both be set"); } long numExistParams = Stream.of(command, name, config).filter(Optional::isPresent).count(); if ( numExistParams > 1) { throw new ConfigException("Only the command or one of the config and name params may be set"); } else if (numExistParams == 0) { throw new ConfigException("No parameter is set"); } if (command.isPresent()) { if (command.get().endsWith(".yml") || command.get().endsWith(".yaml")) { this.embulkConfig = Optional.of(compileEmbulkConfig(params, command.get())); this.sessionName = Optional.absent(); } else { this.embulkConfig = Optional.absent(); this.sessionName = Optional.of(command.get()); } } else if (name.isPresent()) { this.embulkConfig = Optional.absent(); this.sessionName = name; } else { this.embulkConfig = Optional.of(config.get().getInternalObjectNode()); this.sessionName = Optional.absent(); } }