auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public LabelType(String name, List<LabelValue> valueList) { this.name = checkName(name); canOverride = true; values = sortValues(valueList); <START> defaultValue = new LabelValue((short) 0, "No Score"); <END> abbreviation = defaultAbbreviation(name); functionName = "MaxWithBlock"; maxNegative = Short.MIN_VALUE; maxPositive = Short.MAX_VALUE; if (values.size() > 0) { if (values.get(0).getValue() < 0) { maxNegative = values.get(0).getValue(); } if (values.get(values.size() - 1).getValue() > 0) { maxPositive = values.get(values.size() - 1).getValue(); } } }</code><technical_language>"No Score" is guaranteed description for 0 in valueList. If defaultValue a LabelValue, need scan list. pretty doesn't, a Short</technical_language>

Target:
public LabelType(String name, List<LabelValue> valueList) { this.name = checkName(name); canOverride = true; values = sortValues(valueList); defaultValue = 0; abbreviation = defaultAbbreviation(name); functionName = "MaxWithBlock"; maxNegative = Short.MIN_VALUE; maxPositive = Short.MAX_VALUE; if (values.size() > 0) { if (values.get(0).getValue() < 0) { maxNegative = values.get(0).getValue(); } if (values.get(values.size() - 1).getValue() > 0) { maxPositive = values.get(values.size() - 1).getValue(); } } }
Source:
<code>public static <A> Equal<Zipper<A>> zipperEqual(final Equal<A> ea) { Definition<A> eaDef = ea.def; return equalDef((a1, a2) -> { Zipper<A> x1 = a1; Zipper<A> x2 = a2; <START> x1.move(0); <END> x2.move(0); while (true) { if (!eaDef.equal(x1.focus(), x2.focus())) { return false; } if (x1.atEnd() || x2.atEnd()) { break; } x1 = x1.tryNext(); x2 = x2.tryNext(); } return x1.atEnd() && x2.atEnd(); }); }</code><technical_language>move(0) statements do nothing</technical_language>

Target:
public static <A> Equal<Zipper<A>> zipperEqual(final Equal<A> ea) { Equal<Stream<A>> se = Equal.streamEqual(ea); return equalDef((a1, a2) -> se.eq(a1.lefts(), a2.lefts()) && ea.eq(a1.focus(), a2.focus()) && se.eq(a1.rights(), a2.rights()) ); }
Source:
<code><START> public void onItemFished(ItemFishedEvent event) <END> { logger.info("Item fished"); List<ItemStack> stacks = event.getItemStacks(); stacks.clear(); stacks.add(new ItemStack(Items.SLIME_BALL, 2)); stacks.add(new ItemStack(Items.SNOWBALL, 3)); event.setRodDamage(50); }</code><technical_language>This test cover enough. Modifying stacks is a good start, tests for: * [ ] Modifying stuff related entity, verify works work * [ ] Cancelling event</technical_language>

Target:
public void onItemFished(ItemFishedEvent event) { EntityFishHook hook = event.getHookEntity(); BlockPos bobberPos = hook.getPosition(); Biome biomeFishedAt = hook.getEntityWorld().getBiome(bobberPos); logger.info("Item fished in Biome " + biomeFishedAt.getBiomeName()); if (biomeFishedAt.equals(Biomes.OCEAN)) { logger.info("Canceling the event because biome is ocean"); event.setCanceled(true); } event.damageRodBy(50); }
Source:
<code><START> public void createBranch() throws RestApiException { <END> gApi.projects() .name(project.get()) .branch("foo") .create(new BranchInput()); }</code><technical_language>Non-refactoring change</technical_language>

Target:
public void createBranch() throws GitAPIException, IOException, RestApiException { gApi.projects() .name(project.get()) .branch("foo") .create(new BranchInput()); }
Source:
<code>public void testDeadWriterNotification() throws Exception { final OutputStream os = new RemoteOutputStream(new OutputStream() { @Override public void write(int b) throws IOException { System.gc(); <START> throw (IOException) new IOException(MESSAGE, (Exception) DummyClassLoader.apply(TestCallable.class)); <END> } }); channel.call(new DeadWriterCallable(os)); }</code><technical_language>suggestion throw new IOException(MESSAGE, (Exception) DummyClassLoader.apply(TestCallable.class));</technical_language>

Target:
public void testDeadWriterNotification() throws Exception { final OutputStream os = new RemoteOutputStream(new OutputStream() { @Override public void write(int b) throws IOException { System.gc(); throw new IOException(MESSAGE, (Exception) DummyClassLoader.apply(TestCallable.class)); } }); channel.call(new DeadWriterCallable(os)); }
Source:
<code>private Callable<Void> getConnectorStartingCallable(final String connectorName) { return new Callable<Void>() { @Override public Void call() throws Exception { try { startConnector(connectorName, (error, result) -> { }); } catch (Throwable t) { <START> log.error("Couldn't instantiate connector " + connectorName + " because it has an invalid connector " + <END> "configuration. This connector will not execute until reconfigured.", t); onFailure(connectorName, t); } return null; } }; }</code><technical_language>Is trigger this log statement now? this moved callback</technical_language>

Target:
private Callable<Void> getConnectorStartingCallable(final String connectorName) { return new Callable<Void>() { @Override public Void call() throws Exception { try { startConnector(connectorName, (error, result) -> { if (error != null) { log.error("Failed to start connector '" + connectorName + "'", error); } }); } catch (Throwable t) { log.error("Unexpected error while trying to start connector " + connectorName, t); onFailure(connectorName, t); } return null; } }; }
Source:
<code>private void putImageInRegistry() throws InterruptedException { <START> client.pullImageCmd("alpine:latest") <END> .exec(new PullImageResultCallback()) .awaitCompletion(1, TimeUnit.MINUTES); final String id = client.listImagesCmd() .withImageNameFilter("alpine:latest") .exec() .get(0) .getId(); client.tagImageCmd(id, testImageName, "latest").exec(); client.pushImageCmd(testImageNameWithTag) .exec(new PushImageResultCallback()) .awaitCompletion(1, TimeUnit.MINUTES); client.removeImageCmd(testImageNameWithTag).withForce(true).exec(); }</code><technical_language>If TestcontainersConfiguration.getInstance().getRyukImage() here, pull</technical_language>

Target:
private void putImageInRegistry() throws InterruptedException { final String dummySourceImage = TestcontainersConfiguration.getInstance().getRyukImage(); client.pullImageCmd(dummySourceImage) .exec(new PullImageResultCallback()) .awaitCompletion(1, TimeUnit.MINUTES); final String id = client.inspectImageCmd(dummySourceImage) .exec() .getId(); client.tagImageCmd(id, testImageName, "latest").exec(); client.pushImageCmd(testImageNameWithTag) .exec(new PushImageResultCallback()) .awaitCompletion(1, TimeUnit.MINUTES); client.removeImageCmd(testImageNameWithTag).withForce(true).exec(); }
Source:
<code>public synchronized String format(long value) { <START> <END> long date = value / 1000000; long sec = value / 1000000000; long ms = Math.abs(value) % 1000000000 / 1000000; long cs = Math.abs(value) % 1000000 / 1000; long ns = Math.abs(value) % 1000; if (value < 0 && ms + cs + ns > 0 && !fPattern.contains("T")) { date -= 1; ms = (1000000000 - (1000000 * ms + 1000 * cs + ns)) / 1000000; cs = (1000000000 - (1000000 * ms + 1000 * cs + ns)) % 1000000 / 1000; ns = (1000000000 - (1000000 * ms + 1000 * cs + ns)) % 1000; } StringBuffer result = new StringBuffer(super.format(date)); int loc = result.indexOf(fCloseBracket + "'" + fOpenBracket); while (loc != -1) { result.deleteCharAt(loc + fCloseBracket.length()); loc = result.indexOf(fCloseBracket + "'" + fOpenBracket); } for (String pattern : fSupplPatterns) { int length = pattern.length(); StringBuffer fmt = new StringBuffer(length); for (int i = 0; i < length; i++) { fmt.append("0"); } DecimalFormat dfmt = new DecimalFormat(fmt.toString()); String fmtVal = ""; switch (pattern.charAt(0)) { case 'T': if (value < 0 && sec == 0) { result.insert(0, '-'); } fmtVal = dfmt.format(sec); break; case 'S': fmtVal = dfmt.format(ms); break; case 'C': fmtVal = dfmt.format(cs); break; case 'N': fmtVal = dfmt.format(ns); break; default: break; } String ph = new StringBuffer(fOpenBracket + pattern + fCloseBracket).toString(); loc = result.indexOf(ph); result.replace(loc, loc + length + fOpenBracket.length() + fCloseBracket.length(), fmtVal); } return result.toString(); }</code><technical_language>This fix for negative values in a separate commit. test case for in timestamp test cases</technical_language>

Target:
public synchronized String format(long value) { long sec = value / 1000000000; long ms = value % 1000000000 / 1000000; long cs = value % 1000000 / 1000; long ns = value % 1000; StringBuffer result = new StringBuffer(super.format(sec * 1000 + ms)); int loc = result.indexOf(fCloseBracket + "'" + fOpenBracket); while (loc != -1) { result.deleteCharAt(loc + fCloseBracket.length()); loc = result.indexOf(fCloseBracket + "'" + fOpenBracket); } for (String pattern : fSupplPatterns) { int length = pattern.length(); StringBuffer fmt = new StringBuffer(length); for (int i = 0; i < length; i++) { fmt.append("0"); } DecimalFormat dfmt = new DecimalFormat(fmt.toString()); String fmtVal = ""; switch (pattern.charAt(0)) { case 'T': fmtVal = dfmt.format(sec); break; case 'S': fmtVal = dfmt.format(ms); break; case 'C': fmtVal = dfmt.format(cs); break; case 'N': fmtVal = dfmt.format(ns); break; default: break; } String ph = new StringBuffer(fOpenBracket + pattern + fCloseBracket).toString(); loc = result.indexOf(ph); result.replace(loc, loc + length + fOpenBracket.length() + fCloseBracket.length(), fmtVal); } return result.toString(); }
Source:
<code>private Map<@NonNull String, @NonNull OutputElementStyle> getStyles() { if (fStylesMap == null) { <START> fStylesMap = new HashMap<>(); <END> synchronized (fProviders) { for (ITimeGraphDataProvider<?> provider : fProviders) { if (provider instanceof IOutputStyleProvider) { TmfModelResponse<@NonNull OutputStyleModel> styleResponse = ((IOutputStyleProvider) provider).fetchStyle(getStyleParameters(), null); OutputStyleModel styleModel = styleResponse.getModel(); if (styleModel != null) { Map<@NonNull String, @NonNull OutputElementStyle> currentStyleMap = styleModel.getStyles(); fStylesMap.putAll(currentStyleMap); } } } } } return fStylesMap; }</code><technical_language>need a LinkedHashMap legend is in a random order</technical_language>

Target:
private Map<@NonNull String, @NonNull OutputElementStyle> getStyles() { if (fStylesMap == null) { fStylesMap = new LinkedHashMap<>(); synchronized (fProviders) { for (ITimeGraphDataProvider<?> provider : fProviders) { if (provider instanceof IOutputStyleProvider) { TmfModelResponse<@NonNull OutputStyleModel> styleResponse = ((IOutputStyleProvider) provider).fetchStyle(getStyleParameters(), null); OutputStyleModel styleModel = styleResponse.getModel(); if (styleModel != null) { Map<@NonNull String, @NonNull OutputElementStyle> currentStyleMap = styleModel.getStyles(); fStylesMap.putAll(currentStyleMap); } } } } } return fStylesMap; }
Source:
<code>public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) throws APIException { <START> if (attributes == null || !attributes.isEmpty()) { <END> throw new APIException("Patient.no.attribute", (Object[]) null); } return dao.getDuplicatePatientsByAttributes(attributes); }</code><technical_language>line correctly? :)</technical_language>

Target:
public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) throws APIException { if (attributes == null || attributes.isEmpty()) { throw new APIException("Patient.no.attribute", (Object[]) null); } return dao.getDuplicatePatientsByAttributes(attributes); }
Source:
<code>public void testEnvironmentVars() { Map<String, String> vars = new HashMap<>(); vars.put("RABBITMQ_TEST_ADMIN_PASSWORD", "FOO"); vars.put("RABBITMQ_TEST_ADMIN_URI", "http://foo/bar"); vars.put("RABBITMQ_TEST_ADMIN_USER", "BAR"); vars.put("RABBITMQ_TEST_HOSTNAME", "BAZ"); vars.put("RABBITMQ_TEST_PASSWORD", "QUX"); vars.put("RABBITMQ_TEST_PORT", "2345"); <START> vars.put("RABBITMQ_TEST_USER", "FIZ"); <END> BrokerRunning.setEnvironmentVariables(vars); BrokerRunning brokerRunning = BrokerRunning.isBrokerAndManagementRunning(); assertEquals("http://foo/bar", brokerRunning.getAdminUri()); ConnectionFactory connectionFactory = brokerRunning.getConnectionFactory(); assertEquals("BAZ", connectionFactory.getHost()); assertEquals(2345, connectionFactory.getPort()); assertEquals("FIZ", connectionFactory.getUsername()); assertEquals("QUX", connectionFactory.getPassword()); DirectFieldAccessor dfa = new DirectFieldAccessor(brokerRunning); assertEquals("BAR", dfa.getPropertyValue("adminUser")); assertEquals("FOO", dfa.getPropertyValue("adminPassword")); }</code><technical_language>I guess constants BrokerRunning for definitions, yeah, ENV way. So, this is fine for demonstration target names</technical_language>

Target:
public void testEnvironmentVars() { Map<String, String> vars = new HashMap<>(); vars.put("RABBITMQ_TEST_ADMIN_PASSWORD", "FOO"); vars.put("RABBITMQ_TEST_ADMIN_URI", "http://foo/bar"); vars.put("RABBITMQ_TEST_ADMIN_USER", "BAR"); vars.put("RABBITMQ_TEST_HOSTNAME", "BAZ"); vars.put("RABBITMQ_TEST_PASSWORD", "QUX"); vars.put("RABBITMQ_TEST_PORT", "2345"); vars.put("RABBITMQ_TEST_USER", "FIZ"); BrokerRunning.setEnvironmentVariableOverrides(vars); BrokerRunning brokerRunning = BrokerRunning.isBrokerAndManagementRunning(); assertEquals("http://foo/bar", brokerRunning.getAdminUri()); ConnectionFactory connectionFactory = brokerRunning.getConnectionFactory(); assertEquals("BAZ", connectionFactory.getHost()); assertEquals(2345, connectionFactory.getPort()); assertEquals("FIZ", connectionFactory.getUsername()); assertEquals("QUX", connectionFactory.getPassword()); DirectFieldAccessor dfa = new DirectFieldAccessor(brokerRunning); assertEquals("BAR", dfa.getPropertyValue("adminUser")); assertEquals("FOO", dfa.getPropertyValue("adminPassword")); BrokerRunning.clearEnvironmentVariableOverrides(); }
Source:
<code>public void testInspectVolume() throws Exception { requireDockerApiVersionAtLeast("1.21", "volumes"); final Volume volume = sut.createVolume(); assertEquals(volume, sut.inspectVolume(volume.name())); final String badVolumeName = "this-is-a-very-unlikely-volume-name"; try { sut.inspectVolume(badVolumeName); <START> fail("We should not have found a volume with name " + badVolumeName); <END> } catch (VolumeNotFoundException e) { assertEquals(badVolumeName, e.getVolumeName()); } sut.removeVolume(volume); }</code><technical_language>junit ExpectedException here? <LINK_0></technical_language>

Target:
public void testInspectVolume() throws Exception { requireDockerApiVersionAtLeast("1.21", "volumes"); final Volume volume = sut.createVolume(); assertEquals(volume, sut.inspectVolume(volume.name())); sut.removeVolume(volume); final String badVolumeName = "this-is-a-very-unlikely-volume-name"; exception.expect(VolumeNotFoundException.class); exception.expect(volumeNotFoundExceptionWithName(badVolumeName)); sut.inspectVolume(badVolumeName); }
Source:
<code>public static void saveModuleToFile(Module module, File toFile) throws IOException { String moduleInfoJson = moduleToJsonString(module); if (!toFile.getParentFile().exists()) { toFile.getParentFile().mkdirs(); } if (!toFile.exists()) { toFile.createNewFile(); } <START> Files.write(moduleInfoJson, toFile, Charsets.UTF_8); <END> }</code><technical_language>Files.write is deprecated. Please Files.asCharSink: suggestion Files.asCharSink(toFile, Charsets.UTF_8).write(moduleInfoJson);</technical_language>

Target:
public static void saveModuleToFile(Module module, File toFile) throws IOException { String moduleInfoJson = moduleToJsonString(module); if (!toFile.getParentFile().exists()) { toFile.getParentFile().mkdirs(); } if (!toFile.exists()) { toFile.createNewFile(); } Files.asCharSink(toFile, Charsets.UTF_8).write(moduleInfoJson); }
Source:
<code>void setup() { MockitoAnnotations.initMocks(this); <START> when(message.getLockToken()).thenReturn(LOCK_TOKEN); <END> when(asyncClient.getEntityPath()).thenReturn(ENTITY_PATH); when(asyncClient.getFullyQualifiedNamespace()).thenReturn(NAMESPACE); when(asyncClient.getReceiverOptions()).thenReturn(new ReceiverOptions(ReceiveMode.PEEK_LOCK, 1)); client = new ServiceBusReceiverClient(asyncClient, OPERATION_TIMEOUT); }</code><technical_language>Do need this? is assert message is equal</technical_language>

Target:
void setup() { MockitoAnnotations.initMocks(this); when(asyncClient.getEntityPath()).thenReturn(ENTITY_PATH); when(asyncClient.getFullyQualifiedNamespace()).thenReturn(NAMESPACE); when(asyncClient.getReceiverOptions()).thenReturn(new ReceiverOptions(ReceiveMode.PEEK_LOCK, 1)); client = new ServiceBusReceiverClient(asyncClient, OPERATION_TIMEOUT); }
Source:
<code>public boolean equals(final Object o) { if (this == o) { return true; } if (o == null) { return false; } <START> if (this.getClass() != o.getClass()) { <END> return false; } final SAMSequenceRecord that = (SAMSequenceRecord) o; if (mSequenceIndex != that.mSequenceIndex) return false; if (mSequenceLength != that.mSequenceLength) return false; if (!attributesEqual(that)) return false; if (mSequenceName != that.mSequenceName) return false; return true; }</code><technical_language>Similarly - I people tend subclass SAMSequenceRecord, I this class continue implement logical equality require type equality</technical_language>

Target:
public boolean equals(final Object o) { if (this == o) return true; if (o == null) return false; if (this.getClass() != o.getClass()) return false; final SAMSequenceRecord that = (SAMSequenceRecord) o; if (mSequenceIndex != that.mSequenceIndex) return false; if (mSequenceLength != that.mSequenceLength) return false; if (!attributesEqual(that)) return false; if (mSequenceName != that.mSequenceName) return false; return true; }
Source:
<code>public void testRehashes() throws PersistenceException { MagicKey k = new MagicKey("k", c1); c1.put(k, "v"); Cache<Object, String>[] owners = getOwners(k); log.infof("Initial owners list for key %s: %s", k, Arrays.asList(owners)); for (Cache<Object, String> c: Arrays.asList(c1, c2, c3)) { DummyInMemoryStore dims = TestingUtil.getFirstStore(c); <START> assert dims.contains(k) : format("CacheStore on %s should contain key %s", c, k); <END> } Cache<Object, String> primaryOwner = owners[0]; if (getCacheStoreStats(primaryOwner, "write") == 0) primaryOwner = owners[1]; for (Cache<Object, String> c: owners) { int numWrites = getCacheStoreStats(c, "write"); assert numWrites == 1 : "store() should have been invoked on the cache store once. Was " + numWrites; } log.infof("Stopping node %s", primaryOwner); caches.remove(primaryOwner); primaryOwner.stop(); primaryOwner.getCacheManager().stop(); TestingUtil.blockUntilViewsReceived(60000, false, caches); TestingUtil.waitForNoRebalance(caches); owners = getOwners(k); log.infof("After shutting one node down, owners list for key %s: %s", k, Arrays.asList(owners)); assert owners.length == numOwners; for (Cache<Object, String> o : owners) { int numWrites = getCacheStoreStats(o, "write"); assert numWrites == 1 : "store() should have been invoked on the cache store once. Was " + numWrites; assert "v".equals(o.get(k)) : "Should be able to see key on new owner"; } }</code><technical_language>assertEquals()</technical_language>

Target:
public void testRehashes() throws PersistenceException { MagicKey k = new MagicKey("k", c1); c1.put(k, "v"); Cache<Object, String>[] owners = getOwners(k); log.infof("Initial owners list for key %s: %s", k, Arrays.asList(owners)); for (Cache<Object, String> c: Arrays.asList(c1, c2, c3)) { DummyInMemoryStore dims = TestingUtil.getFirstStore(c); assertTrue("CacheStore on " + c + " should contain key " + k, dims.contains(k)); } Cache<Object, String> primaryOwner = owners[0]; if (getCacheStoreStats(primaryOwner, "write") == 0) primaryOwner = owners[1]; for (Cache<Object, String> c: owners) { int numWrites = getCacheStoreStats(c, "write"); assertEquals(1, numWrites); } log.infof("Stopping node %s", primaryOwner); caches.remove(primaryOwner); primaryOwner.stop(); primaryOwner.getCacheManager().stop(); TestingUtil.blockUntilViewsReceived(60000, false, caches); TestingUtil.waitForNoRebalance(caches); owners = getOwners(k); log.infof("After shutting one node down, owners list for key %s: %s", k, Arrays.asList(owners)); assertEquals(numOwners, owners.length); for (Cache<Object, String> o : owners) { int numWrites = getCacheStoreStats(o, "write"); assertEquals(1, numWrites); assertEquals("v", o.get(k)); } }
Source:
<code>public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.UNTAP_STEP_PRE) { reset(); return; } if (game.getPhase() != null && event.getType() == GameEvent.EventType.DREW_CARD) { UUID playerId = event.getPlayerId(); if (playerId != null) { amountOfCardsDrawnThisTurn.putIfAbsent(playerId, 0); amountOfCardsDrawnThisTurn.compute(playerId, (p, amount) -> amount + 1); <START> if (amountOfCardsDrawnThisTurn.get(playerId) == 1) { <END> checkMiracleAbility(event, game); } } } }</code><technical_language>Integer amount = 1 + amountOfCardsDrawnThisTurn.getOrDefault(playerId, 0); amountOfCardsDrawnThisTurn.put(playerId, amount); if (amount == 1) { // do stuff }</technical_language>

Target:
public void watch(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.UNTAP_STEP_PRE) { reset(); return; } if (game.getPhase() != null && event.getType() == GameEvent.EventType.DREW_CARD) { UUID playerId = event.getPlayerId(); if (playerId != null) { Integer amount = 1 + amountOfCardsDrawnThisTurn.getOrDefault(playerId, 0); amountOfCardsDrawnThisTurn.put(playerId, amount); if (amount == 1) { checkMiracleAbility(event, game); } } } }
Source:
<code>protected boolean checkIfLunDiskCanBeAdded(DiskValidator diskValidator) { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } if (!validate(diskValidator.isVirtIoScsiValid(getVm()))) { return false; } if (!validate(diskValidator.isDiskInterfaceSupported(getVm()))) { return false; } if (getVds() != null && !validate(diskValidator.isLunDiskVisible(lun, getVds()))) { return false; } LunDisk lunDisk = ((LunDisk) getParameters().getDiskInfo()); if (lunDisk.isUsingScsiReservation() && !lunDisk.isScsiPassthrough()) <START> { <END> return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_PASSTHROUGH_IS_DISABLED); } return true; }</code><technical_language>please this logic in validator other validations</technical_language>

Target:
protected boolean checkIfLunDiskCanBeAdded(DiskValidator diskValidator) { LUNs lun = ((LunDisk) getParameters().getDiskInfo()).getLun(); switch (lun.getLunType()) { case UNKNOWN: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE); case ISCSI: if (lun.getLunConnections() == null || lun.getLunConnections().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } for (StorageServerConnections conn : lun.getLunConnections()) { if (StringUtils.isEmpty(conn.getiqn()) || StringUtils.isEmpty(conn.getconnection()) || StringUtils.isEmpty(conn.getport())) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_ISCSI_MISSING_CONNECTION_PARAMS); } } break; } if (getDiskLunMapDao().getDiskIdByLunId(lun.getLUN_id()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_IS_ALREADY_IN_USE); } if (getVm() != null && !(isVmNotLocked() && isVmNotInPreviewSnapshot())) { return false; } if (!validate(diskValidator.isVirtIoScsiValid(getVm()))) { return false; } if (!validate(diskValidator.isDiskInterfaceSupported(getVm()))) { return false; } if (getVds() != null && !validate(diskValidator.isLunDiskVisible(lun, getVds()))) { return false; } LunDisk lunDisk = ((LunDisk) getParameters().getDiskInfo()); ValidationResult validationResult = diskValidator.isUsingScsiReservationValid(lunDisk); if (!validate(validationResult)) { return failCanDoAction(validationResult.getMessage()); } return true; }
Source:
<code>public CtfTmfEvent getCurrentEvent() { final StreamInputReader top = super.getPrio().peek(); if (top != null) { <START> if (hashCode() != previousHashCode) { <END> previousHashCode = hashCode(); previousCurrentEvent = CtfTmfEventFactory.createEvent(top.getCurrentEvent(), top.getFilename(), fTrace); } return previousCurrentEvent; } return null; }</code><technical_language>hashCode() calls hashcode of this iterator object. faster/more representative check hashCode of fCurrentLocation</technical_language>

Target:
public synchronized CtfTmfEvent getCurrentEvent() { final StreamInputReader top = super.getPrio().peek(); if (top != null) { if (fCurLocation.hashCode() != fPreviousHashCode) { fPreviousHashCode = fCurLocation.hashCode(); fPreviousCurEvent = CtfTmfEventFactory.createEvent(top.getCurrentEvent(), top.getFilename(), fTrace); } return fPreviousCurEvent; } return null; }
Source:
<code>public List<Pipeline> getPipelinesSync() throws TimeoutException { <START> return getPipelinesSync(TimeUnit.SECONDS.toMillis(pollingIntervalSeconds)); <END> }</code><technical_language>pollingIntervalSeconds is correct maximum time wait here. In general, this is resolving case Echo starts processing events PipelineCache starts polling. time wait is then: (time event processor starting pipeline cache starting) + (time get a response a single poll) is independent of time polls. said, reasonable values of polling interval (~10-60 seconds) reasonable values for this timeout, end result is fine</technical_language>

Target:
public List<Pipeline> getPipelinesSync() throws TimeoutException { return getPipelinesSync(pollingIntervalMs); }
Source:
<code>protected Optional<Optional<org.spongepowered.api.entity.Entity>> getVal(Entity dataHolder) { <START> if (!(dataHolder instanceof IEntityTargetingEntity)) <END> return Optional.empty(); return Optional.of(Optional.ofNullable((org.spongepowered.api.entity.Entity) ((IEntityTargetingEntity) dataHolder).getTargetedEntity())); }</code><technical_language>Braces</technical_language>

Target:
protected Optional<org.spongepowered.api.entity.EntitySnapshot> getVal(Entity dataHolder) { Entity entity = ((IEntityTargetingEntity) dataHolder).getTargetedEntity(); if (entity == null) { return Optional.empty(); } return Optional.of(((org.spongepowered.api.entity.Entity) entity).createSnapshot()); }
Source:
<code>private void deleteWithRetries(final String s3Bucket, final String s3Path) throws Exception { RetryUtils.retry( (Callable<Void>) () -> { try { s3Client.deleteObject(s3Bucket, s3Path); if (s3Client.isObjectInBucket(s3Bucket, s3Path)) { <START> throw new IOException(StringUtils.format( <END> "After delete reported as successful the deleted file [s3://%s/%s] still exists", s3Bucket, s3Path )); } return null; } catch (Exception e) { log.info(e, "Error while trying to delete [s3://%s/%s]", s3Bucket, s3Path); throw e; } }, S3Utils.S3RETRY, 3 ); }</code><technical_language>is this guaranteed case in S3</technical_language>

Target:
private void deleteWithRetries(final String s3Bucket, final String s3Path) throws Exception { RetryUtils.retry( (Callable<Void>) () -> { try { s3Client.deleteObject(s3Bucket, s3Path); return null; } catch (Exception e) { log.info(e, "Error while trying to delete [s3://%s/%s]", s3Bucket, s3Path); throw e; } }, S3Utils.S3RETRY, 3 ); }
Source:
<code>public static void deleteHistoryLogging() { File folderLogs = new File(mFolder + File.separator); if(folderLogs.isDirectory()){ String[] myFiles = folderLogs.list(); <START> for (String myFile1 : myFiles) { <END> File myFile = new File(folderLogs, myFile1); Log_OC.d("delete file", myFile.getAbsoluteFile() + " " + myFile.delete()); } } }</code><technical_language>call myFile instead of myFile1</technical_language>

Target:
public static void deleteHistoryLogging() { File folderLogs = new File(mFolder + File.separator); if (folderLogs.isDirectory()) { String[] myFiles = folderLogs.list(); for (String fileName : myFiles) { File fileInFolder = new File(folderLogs, fileName); Log_OC.d("delete file", fileInFolder.getAbsoluteFile() + " " + fileInFolder.delete()); } } }
Source:
<code>public static void main(String[] args) throws ConfigurationException, FileNotFoundException { logger.info("Starting the Microservice with Metrics"); URL resource = Application.class.getClassLoader().getResource("metrics.yaml"); if (resource == null) { throw new FileNotFoundException("Metrics configuration resource not found"); } Path configPath = new File(resource.getFile()).toPath(); <START> ConfigProvider configProvider = ConfigProviderFactory.getConfigProvider(configPath, null); <END> org.wso2.msf4j.analytics.internal.DataHolder.getInstance().setConfigProvider(configProvider); new MicroservicesRunner() .addInterceptor(new MetricsInterceptor()) .deploy(new DemoService()) .start(); }</code><technical_language>move this logic org.wso2.msf4j.analytics.metrics.Metrics class. check configProvider if load default one. allow user set configuration file in system property</technical_language>

Target:
public static void main(String[] args) { logger.info("Starting the Microservice with Metrics"); new MicroservicesRunner() .addInterceptor(new MetricsInterceptor()) .deploy(new DemoService()) .start(); }
Source:
<code>public void rollOver() { <START> File file; <END> if (qw != null) { long size = ((CountingQuietWriter)qw).getCount(); LogLog.debug("rolling over count=" + size); } LogLog.debug("maxBackupIndex=" + maxBackupIndex); boolean deleteSucceeded = true; int nextFileIndex = (currentFileIndex + 1) % maxBackupIndex; String nextFileName = fileName + '.' + nextFileIndex; if (maxBackupIndex > 0) { file = new File(nextFileName); if (file.exists()) { deleteSucceeded = file.delete(); } if (deleteSucceeded) { this.closeFile(); } else { try { this.setFile(fileName, true, bufferedIO, bufferSize); } catch (IOException e) { if (e instanceof InterruptedIOException) { Thread.currentThread().interrupt(); } LogLog.error("setFile(" + fileName + ", true) call failed.", e); } } } currentFileIndex = nextFileIndex; if (deleteSucceeded) { try { this.setFile(fileName, false, bufferedIO, bufferSize); } catch (IOException e) { if (e instanceof InterruptedIOException) { Thread.currentThread().interrupt(); } LogLog.error("setFile(" + fileName + ", false) call failed.", e); } } }</code><technical_language>this file variable need declared if (maxBackupIndex > 0)</technical_language>

Target:
public void rollOver() { if (qw != null) { long size = ((CountingQuietWriter)qw).getCount(); LogLog.debug("rolling over count=" + size); } LogLog.debug("maxBackupIndex=" + maxBackupIndex); boolean deleteSucceeded = true; int nextFileIndex = (currentFileIndex + 1) % maxBackupIndex; String nextFileName = fileName + '.' + nextFileIndex; if (maxBackupIndex > 0) { File file = new File(nextFileName); if (file.exists()) { deleteSucceeded = file.delete(); } if (deleteSucceeded) { this.closeFile(); } else { try { this.setFile(fileName, true, bufferedIO, bufferSize); } catch (IOException e) { if (e instanceof InterruptedIOException) { Thread.currentThread().interrupt(); } LogLog.error("setFile(" + fileName + ", true) call failed.", e); } } } currentFileIndex = nextFileIndex; if (deleteSucceeded) { try { this.setFile(fileName, false, bufferedIO, bufferSize); } catch (IOException e) { if (e instanceof InterruptedIOException) { Thread.currentThread().interrupt(); } LogLog.error("setFile(" + fileName + ", false) call failed.", e); } } }
Source:
<code>public void decorateHeaderCell() { HeaderCell cell = m_headerCell; decorateHeaderCellInternal(cell); try { execDecorateHeaderCell(cell); <START> getTable().getColumnSet().updateColumn(this); <END> } catch (ProcessingException e) { LOG.warn(null, e); } catch (Throwable t) { LOG.warn(null, t); } }</code><technical_language>this give a NullPointerException getTable() return null</technical_language>

Target:
public void decorateHeaderCell() { HeaderCell cell = m_headerCell; decorateHeaderCellInternal(cell); try { execDecorateHeaderCell(cell); if (getTable() != null && getTable().getColumnSet() != null) { getTable().getColumnSet().updateColumn(this); } } catch (ProcessingException e) { LOG.warn(null, e); } catch (Throwable t) { LOG.warn(null, t); } }
Source:
<code>public boolean connectorExists(String id) { try { <START> List<ConnectorConfiguration> list = <END> configPersistence.load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id)); if (list.isEmpty()) { return false; } return true; } catch (PersistenceException e) { throw new RuntimeException(e); } }</code><technical_language>wrong indentation in this method</technical_language>

Target:
public Boolean connectorExists(String id) { try { List<ConnectorConfiguration> list = configPersistence.load(ImmutableMap.of(Constants.CONNECTOR_PERSISTENT_ID, id)); return !list.isEmpty(); } catch (PersistenceException e) { throw new RuntimeException(e); } }
Source:
<code>private void captureScreenshot(ITestResult result, SeleniumWebDriver webDriver) { String testName = result.getTestClass().getName() + "." + result.getMethod().getMethodName(); String filename = NameGenerator.generate(testName + "_", 8) + ".png"; try { <START> String pageSource = webDriver.getPageSource(); <END> Path dmpDirectory = Paths.get("target/htmldump", filename + ".html"); Files.createDirectories(dmpDirectory.getParent()); Files.write(dmpDirectory, pageSource.getBytes(), StandardOpenOption.CREATE); byte[] data = webDriver.getScreenshotAs(OutputType.BYTES); Path screenshot = Paths.get(screenshotDir, filename); Files.createDirectories(screenshot.getParent()); Files.copy(new ByteArrayInputStream(data), screenshot); } catch (WebDriverException | IOException e) { LOG.error(format("Can't capture screenshot for test %s", testName), e); } }</code><technical_language>Add a new method dump page</technical_language>

Target:
private void captureScreenshot(ITestResult result, SeleniumWebDriver webDriver) { String testName = result.getTestClass().getName() + "." + result.getMethod().getMethodName(); String filename = NameGenerator.generate(testName + "_", 8) + ".png"; try { byte[] data = webDriver.getScreenshotAs(OutputType.BYTES); Path screenshot = Paths.get(screenshotDir, filename); Files.createDirectories(screenshot.getParent()); Files.copy(new ByteArrayInputStream(data), screenshot); } catch (WebDriverException | IOException e) { LOG.error(format("Can't capture screenshot for test %s", testName), e); } }
Source:
<code>public void testInitialization() throws Exception { <START> try (IgniteLock lock = createReentrantLock(0, "lock1", false)) { <END> } try (IgniteLock lock = createReentrantLock(0, "lock2", true)) { } }</code><technical_language>mb, "lock1" -> "unfair lock" "lock2" -> "fair lock"</technical_language>

Target:
public void testInitialization() { try (IgniteLock ignore = createReentrantLock(0, "unfair lock", false)) { } try (IgniteLock ignore = createReentrantLock(0, "fair lock", true)) { } }
Source:
<code>private List<VMImage> listImagesByLocation(String location) { final List<VMImage> osImages = Lists.newArrayList(); <START> final List<Publisher> publisherList = api.getOSImageApi(location).listPublishers(); <END> Iterable<String> publishers = Splitter.on(',').trimResults().omitEmptyStrings().split(this.azureComputeConstants.azureImagePublishers()); for (String publisher : publishers) { getImagesFromPublisher(publisher, osImages, location); } return osImages; }</code><technical_language>This is used</technical_language>

Target:
private List<VMImage> listImagesByLocation(String location) { final List<VMImage> osImages = Lists.newArrayList(); Iterable<String> publishers = Splitter.on(',').trimResults().omitEmptyStrings().split(this.azureComputeConstants.azureImagePublishers()); for (String publisher : publishers) { getImagesFromPublisher(publisher, osImages, location); } return osImages; }
Source:
<code>private void validatePort() { boolean inUse = serverHelper.isPortInUse(port); do { if (inUse) { String message = String.format("Port %s is already in use. Can we use %s? Otherwise the run will fail.", port, port + 1); boolean promptToChange = wizard.promptYesNo(message); if (promptToChange) { ++port; <START> wizard.showMessage(String.format("Testing port %s", port)); <END> inUse = serverHelper.isPortInUse(port); } else { break; } } } while (inUse); }</code><technical_language>Please remove here. I asked include a similar message in isPortInUse</technical_language>

Target:
private void validatePort() { boolean inUse = false; int tmpPort = port; inUse = serverHelper.checkPortUsage(tmpPort); if (inUse) { tmpPort = serverHelper.findNearestPort(tmpPort); } else { return; } String message = String.format("Port %s is already in use. Would you like to use %s instead?", port, tmpPort); boolean promptToChange = wizard.promptYesNo(message); if (promptToChange) { port = tmpPort; return; } this.validatePort(); }
Source:
<code>public void testTableSinkWithMissingKeyField() { Schema inputSchema = Schema.recordOf( "purchase", Schema.Field.of("uniqueId", Schema.of(Schema.Type.STRING)), Schema.Field.of("user", Schema.of(Schema.Type.STRING)) ); KVTableSink.KVTableConfig kvTableConfig = new KVTableSink.KVTableConfig("purchases", "rowKey", "user"); KVTableSink kvTableSink = new KVTableSink(kvTableConfig); <START> MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(inputSchema, <END> Collections.<String, Object>emptyMap()); kvTableSink.configurePipeline(mockPipelineConfigurer); }</code><technical_language>is a constructor takes input schema right? If so, one</technical_language>

Target:
public void testTableSinkWithMissingKeyField() { Schema inputSchema = Schema.recordOf( "purchase", Schema.Field.of("uniqueId", Schema.of(Schema.Type.STRING)), Schema.Field.of("user", Schema.of(Schema.Type.STRING)) ); KVTableSink.KVTableConfig kvTableConfig = new KVTableSink.KVTableConfig("purchases", "rowKey", "user"); KVTableSink kvTableSink = new KVTableSink(kvTableConfig); MockPipelineConfigurer mockPipelineConfigurer = new MockPipelineConfigurer(inputSchema); kvTableSink.configurePipeline(mockPipelineConfigurer); }
Source:
<code>public String getRyaInstanceName() { <START> return get(MONGO_DB_NAME, "rya"); <END> }</code><technical_language>application setMongoDBName("a") setRyaInstanceName("b") getMongoDBName() returns "b"? unexpected</technical_language>

Target:
public String getRyaInstanceName() { return get(RYA_INSTANCE_NAME, "rya"); }
Source:
<code>public void shouldPurgeAnAutoGenerationOption() throws Exception { MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); req.addParameter("purge", ""); handle(req); <START> assertNull(identifierSourceService <END> .getAutoGenerationOption(Context.getPatientService().getPatientIdentifierTypeByUuid(getUuid()))); }</code><technical_language>null purging</technical_language>

Target:
public void shouldPurgeAnAutoGenerationOption() throws Exception { assertNotNull(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid()))); MockHttpServletRequest req = request(RequestMethod.DELETE, getURI() + "/" + getUuid()); req.addParameter("purge", ""); handle(req); assertNull(identifierSourceService.getAutoGenerationOption(Integer.parseInt(getUuid()))); }
Source:
<code>public NodeAndInitialCredentials<VirtualMachine> createNodeWithGroupEncodedIntoName(final String group, final String name, final Template template) { VirtualDatacenter vdc = cloudService.getVirtualDatacenter(Integer.valueOf(template.getHardware().getLocation() .getId())); VirtualAppliance vapp = find(vdc.listVirtualAppliances(), new Predicate<VirtualAppliance>() { @Override public boolean apply(VirtualAppliance input) { return input.getName().equals(group); } <START> }); <END> return createNodeWithGroupEncodedIntoName(vdc, vapp, name, template); }</code><technical_language>simple option that, if calls _anyway_ for node, do "if !group.exist create" logic _here_? Of course, race conditions etc. nasty. I guess main aim is _need_ do calls for node, _know_ vdc vapp be..</technical_language>

Target:
public NodeAndInitialCredentials<VirtualMachine> createNodeWithGroupEncodedIntoName(final String group, final String name, final Template template) { checkArgument(template instanceof VirtualApplianceCachingTemplate, "A VirtualApplianceCachingTemplate is required"); return createNodeWithGroupEncodedIntoName(name, VirtualApplianceCachingTemplate.class.cast(template)); }
Source:
<code>private CompletableFuture<Void> nonBlockingClose() { <START> if (this.isClosed) throw new IllegalStateException("Writer is already closed"); <END> this.isClosed = true; return CompletableFuture.supplyAsync(() -> { try { this.blockingClose(); return null; } catch (Exception e) { throw new RuntimeException("Caught exception while closing PooledWriter.", e); } }, AsyncWriterPool.this.executor); }</code><technical_language>I tend this return - I totally reasonable I a user close writers independently (they do implement closeable all) _then_ close pool is call methods again</technical_language>

Target:
private CompletableFuture<Void> nonBlockingClose() { return CompletableFuture.supplyAsync(() -> { try { this.close(); return null; } catch (Exception e) { throw new RuntimeException("Caught exception while closing PooledWriter.", e); } }, AsyncWriterPool.this.executor); }
Source:
<code>public void execute() { final PatchSetContent content = new PatchSetContent(baseSet, targetSet); final IReviewItemSet compareSet = IReviewsFactory.INSTANCE.createReviewItemSet(); String basePatchSetLabel = content.getBase() != null ? content.getBase().getPatchSetId() + "" : "Base"; compareSet.setName(NLS.bind("Compare Patch Set {0} and {1}", content.getTarget().getPatchSetId(), basePatchSetLabel)); getGerritFactoryProvider().getReviewItemSetContentFactory().consume("Compare Items", compareSet, content, "", new RemoteEmfConsumer.IObserver<List<IReviewItem>>() { public void responded(boolean modified) { GerritToGitMapping mapper = getGitRepository(); Repository gitRepository = null; if (mapper != null) { try { <START> gitRepository = mapper.find(); <END> } catch (IOException e) { } } CompareConfiguration configuration = new CompareConfiguration(); CompareUI.openCompareEditor(new ReviewItemSetCompareEditorInput(configuration, compareSet, null, new GerritReviewBehavior(getTask(), gitRepository))); } public void failed(IStatus status) { StatusHandler.log(new Status(IStatus.ERROR, GerritUiPlugin.PLUGIN_ID, "Couldn't load task content for review", status.getException())); } public void created(List<IReviewItem> object) { } }); }</code><technical_language>checking for IOException, is a more fail friendly determine file available? (Concenred masking other issues.)</technical_language>

Target:
public void execute() { final PatchSetContent content = new PatchSetContent(baseSet, targetSet); final IReviewItemSet compareSet = IReviewsFactory.INSTANCE.createReviewItemSet(); String basePatchSetLabel = content.getBase() != null ? content.getBase().getPatchSetId() + "" : "Base"; compareSet.setName(NLS.bind("Compare Patch Set {0} and {1}", content.getTarget().getPatchSetId(), basePatchSetLabel)); RemoteEmfConsumer<IReviewItemSet, List<IReviewItem>, PatchSetContent, PatchSetContent, String> consumer = getGerritFactoryProvider().getReviewItemSetContentFactory() .consume("Compare Items", compareSet, content, "", new RemoteEmfConsumer.IObserver<List<IReviewItem>>() { public void responded(boolean modified) { CompareConfiguration configuration = new CompareConfiguration(); CompareUI.openCompareEditor(new ReviewItemSetCompareEditorInput(configuration, compareSet, null, new GerritReviewBehavior(getTask(), resolveGitRepository()))); } public void failed(IStatus status) { StatusHandler.log(new Status(IStatus.ERROR, GerritUiPlugin.PLUGIN_ID, "Couldn't load task content for review", status.getException())); } public void created(List<IReviewItem> object) { } }); consumer.request(); }
Source:
<code>static X509Certificate selfSignedCertificate() throws CertificateException { return (X509Certificate) SslContext.X509_CERT_FACTORY.generateCertificate( <START> new ByteArrayInputStream(CERT.getBytes()) <END> ); }</code><technical_language>getBytes(CharsetUtil.US_ASCII)</technical_language>

Target:
static X509Certificate selfSignedCertificate() throws CertificateException { return (X509Certificate) SslContext.X509_CERT_FACTORY.generateCertificate( new ByteArrayInputStream(CERT.getBytes(CharsetUtil.US_ASCII)) ); }
Source:
<code>private void notifySelect(boolean ctrl) { int stateMask1 = (ctrl) ? (SWT.BUTTON1 | SWT.CTRL) : SWT.BUTTON1; <START> int stateMask2 = (ctrl) ? (SWT.NONE | SWT.CTRL) : SWT.NONE; <END> notify(SWT.MouseEnter); notify(SWT.MouseMove); notify(SWT.Activate); notify(SWT.FocusIn); notify(SWT.MouseDown, createMouseEvent(0, 0, 1, stateMask2, 1)); notify(SWT.Selection, selectionEvent(stateMask1)); notify(SWT.MouseUp, createMouseEvent(0, 0, 1, stateMask1, 1)); notify(SWT.MouseHover); notify(SWT.MouseMove); notify(SWT.MouseExit); notify(SWT.Deactivate); notify(SWT.FocusOut); }</code><technical_language>more sense invert names (the BUTTON1 is after... call stateMask2)</technical_language>

Target:
private void notifySelect(boolean ctrl) { int stateMask1 = (ctrl) ? (SWT.NONE | SWT.CTRL) : SWT.NONE; int stateMask2 = (ctrl) ? (SWT.BUTTON1 | SWT.CTRL) : SWT.BUTTON1; notify(SWT.MouseEnter); notify(SWT.MouseMove); notify(SWT.Activate); notify(SWT.FocusIn); notify(SWT.MouseDown, createMouseEvent(0, 0, 1, stateMask1, 1)); notify(SWT.Selection, selectionEvent(stateMask2)); notify(SWT.MouseUp, createMouseEvent(0, 0, 1, stateMask2, 1)); notify(SWT.MouseHover); notify(SWT.MouseMove); notify(SWT.MouseExit); notify(SWT.Deactivate); notify(SWT.FocusOut); }
Source:
<code>public int parseArguments(Parameters params) throws CmdLineException { String timestamp = params.getParameter(0); try { DateFormat fmt = new SimpleDateFormat(DATE_FORMAT); fmt.setTimeZone(TimeZone.getTimeZone("UTC")); setter.addValue(new Timestamp(fmt.parse(timestamp).getTime())); return 1; } catch (ParseException e) { throw new CmdLineException(owner, String.format("Invalid <START> timestamp: %s; <END> expected format: %s", timestamp, DATE_FORMAT), e); } }</code><technical_language>call timestamp, in rest-api date</technical_language>

Target:
public int parseArguments(Parameters params) throws CmdLineException { String timestamp = params.getParameter(0); try { DateFormat fmt = new SimpleDateFormat(TIMESTAMP_FORMAT); fmt.setTimeZone(TimeZone.getTimeZone("UTC")); setter.addValue(new Timestamp(fmt.parse(timestamp).getTime())); return 1; } catch (ParseException e) { throw new CmdLineException(owner, String.format("Invalid timestamp: %s; expected format: %s", timestamp, TIMESTAMP_FORMAT), e); } }