auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static String[] generateRootClassesFromWorkspace() { String classpath = System.getProperty("java.class.path"); Object[] binDirectories = extractBinDirectories(classpath); HashSet<String> classFileNames = HashSetFactory.make(); for (Object binDirectorie : binDirectories) { String dir = (String) binDirectorie; File fdir = new File(dir); classFileNames.addAll(findClassNames(dir, fdir)); } String[] result = new String[classFileNames.size()]; Iterator<String> it = classFileNames.iterator(); <START> Arrays.setAll(result, i -> it.next()); <END> return result; }</code><technical_language>toArray</technical_language>

Target:
private static String[] generateRootClassesFromWorkspace() { String classpath = System.getProperty("java.class.path"); Object[] binDirectories = extractBinDirectories(classpath); HashSet<String> classFileNames = HashSetFactory.make(); for (Object binDirectorie : binDirectories) { String dir = (String) binDirectorie; File fdir = new File(dir); classFileNames.addAll(findClassNames(dir, fdir)); } return classFileNames.toArray(new String[0]); }
Source:
<code>public void setup() throws IOException { <START> _embeddedZookeeper = new EmbeddedZookeeper(22183); <END> _zkConnectionString = _embeddedZookeeper.getConnection(); _embeddedZookeeper.startup(); }</code><technical_language>drop port number</technical_language>

Target:
public void setup() throws IOException { _embeddedZookeeper = new EmbeddedZookeeper(); _zkConnectionString = _embeddedZookeeper.getConnection(); _embeddedZookeeper.startup(); }
Source:
<code>public void paintControl(PaintEvent event) { if (fTextWidget != null) { try { handleDrawRequest(event.gc); } catch (IllegalStateException e) { String PLUGIN_ID= "org.eclipse.jface.text"; ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); log.log(new Status(IStatus.ERROR, PLUGIN_ID, <START> JFaceTextMessages.getString("MatchingCharacterPainter.unexpected_error"), <END> e)); return; } } }</code><technical_language>Log messages generally English strings do translation bundles. Messages written log intended read Eclipse developers, end user</technical_language>

Target:
public void paintControl(PaintEvent event) { if (fTextWidget != null) { try { handleDrawRequest(event.gc); } catch (IllegalStateException e) { String PLUGIN_ID= "org.eclipse.jface.text"; ILog log= Platform.getLog(Platform.getBundle(PLUGIN_ID)); log.log(new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage(), e)); } } }
Source:
<code>public void cacheSerializingCopiers() throws Exception { CacheConfiguration<Long, Person> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).build()) <START> .add(new DefaultCopierConfiguration<Long>((Class)SerializingCopier.class, END> CopierConfiguration.Type.VALUE)) .buildConfig(Long.class, Person.class); CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("cache", cacheConfiguration) .build(true); Cache<Long, Person> cache = cacheManager.getCache("cache", Long.class, Person.class); Description desc = new Description(1234, "foo"); Person person = new Person("Bar", 24); cache.put(1l, person); assertThat(cache.get(1l), equalTo(person)); assertThat(cache.get(1l), not(sameInstance(person))); cacheManager.close(); }</code><technical_language>DefaultCopierConfiguration<Person> right??? changed copier config type</technical_language>

Target:
public void cacheSerializingCopiers() throws Exception { CacheConfiguration<Long, Person> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder() .withResourcePools(ResourcePoolsBuilder.newResourcePoolsBuilder().heap(10, EntryUnit.ENTRIES).build()) .add(new DefaultCopierConfiguration<Person>((Class)SerializingCopier.class, CopierConfiguration.Type.VALUE)) .buildConfig(Long.class, Person.class); CacheManager cacheManager = CacheManagerBuilder.newCacheManagerBuilder() .withCache("cache", cacheConfiguration) .build(true); Cache<Long, Person> cache = cacheManager.getCache("cache", Long.class, Person.class); Description desc = new Description(1234, "foo"); Person person = new Person("Bar", 24); cache.put(1l, person); assertThat(cache.get(1l), equalTo(person)); assertThat(cache.get(1l), not(sameInstance(person))); cacheManager.close(); }
Source:
<code>public static String hash(String clearText) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.reset(); md.update(clearText.getBytes("UTF-8")); byte[] bytes = md.digest(); Formatter f = new Formatter(); for (byte b : bytes) f.format("%02x", b); String res = f.toString(); f.close(); return res; } catch (NoSuchAlgorithmException e) { <START> e.printStackTrace(); <END> } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return clearText; }</code><technical_language>logging, print standard out</technical_language>

Target:
public static String hash(String clearText) { try { MessageDigest md = MessageDigest.getInstance("SHA-1"); md.reset(); md.update(clearText.getBytes("UTF-8")); byte[] bytes = md.digest(); Formatter f = new Formatter(); for (byte b : bytes) f.format("%02x", b); String res = f.toString(); f.close(); return res; } catch (NoSuchAlgorithmException e) { Log.e(K9.LOG_TAG, "", e); } catch (UnsupportedEncodingException e) { Log.e(K9.LOG_TAG, "", e); } return clearText; }
Source:
<code>private List<HtmlContext> performAttack (HttpMessage msg, String param, String attack, HtmlContext targetContext, int ignoreFlags, boolean findDecoded) { if (isStop()) { return null; } HttpMessage msg2 = msg.cloneRequest(); setParameter(msg2, param, attack); try { sendAndReceive(msg2); } catch (URIException e) { if (log.isDebugEnabled()) { log.debug("Failed to send HTTP message, cause: " + e.getMessage()); } return null; } catch (InvalidRedirectLocationException|UnknownHostException e) { return null; } catch (Exception e) { log.error(e.getMessage(), e); } if (isStop()) { return null; } HtmlContextAnalyser hca = new HtmlContextAnalyser(msg2); if (Plugin.AlertThreshold.HIGH.equals(this.getAlertThreshold())) { return hca.getHtmlContexts(attack, targetContext, ignoreFlags); } if (findDecoded) { try { <START> return hca.getHtmlContexts(URLDecoder.decode(attack, UTF8), targetContext, ignoreFlags); <END> } catch (UnsupportedEncodingException e) { if (log.isDebugEnabled()) { log.debug("Failed to decode attack payload, cause: " + e.getMessage(), e); } } } return hca.getHtmlContexts(attack); }</code><technical_language>check, this done in HIGH, hca.getHtmlContexts(attack) (with attack decoded)? - getURLDecode(attack) get decoded form</technical_language>

Target:
private List<HtmlContext> performAttack (HttpMessage msg, String param, String attack, HtmlContext targetContext, int ignoreFlags, boolean findDecoded) { if (isStop()) { return null; } HttpMessage msg2 = msg.cloneRequest(); setParameter(msg2, param, attack); try { sendAndReceive(msg2); } catch (URIException e) { if (log.isDebugEnabled()) { log.debug("Failed to send HTTP message, cause: " + e.getMessage()); } return null; } catch (InvalidRedirectLocationException|UnknownHostException e) { return null; } catch (Exception e) { log.error(e.getMessage(), e); } if (isStop()) { return null; } HtmlContextAnalyser hca = new HtmlContextAnalyser(msg2); if (Plugin.AlertThreshold.HIGH.equals(this.getAlertThreshold())) { return hca.getHtmlContexts(findDecoded ? getURLDecode(attack) : attack, targetContext, ignoreFlags); } return hca.getHtmlContexts(findDecoded ? getURLDecode(attack) : attack); }
Source:
<code>public void editingTopic_ifSubscribedToBranchOnly_shouldNotReceiveBranchNotification() throws Exception { User topicCreator = Users.signUpAndSignIn(); Topic topic = Topics.createTopic(new Topic().withBranch(NOTIFICATION_BRANCH)); Users.logout(); User subscribedUser = Users.signUpAndSignIn(); Branches.subscribe(topic.getBranch()); Topics.unsubscribe(topic); <START> Users.signIn(topicCreator); <END> Branches.openBranch(NOTIFICATION_BRANCH); Topics.editPost(topic, selectedPost); Users.logout(); Users.signIn(subscribedUser); unsubscribeIgnoringFail(Branch branch); Notifications.assertNotificationOnTopicNotSentBranchNotSent(topic, subscribedUser); }</code><technical_language>topicCreator created here, top</technical_language>

Target:
public void editingTopic_ifSubscribedToBranchOnly_shouldNotReceiveBranchNotification() throws Exception { User topicCreator = Users.signUpAndSignIn(); Topic topic = Topics.createTopic(new Topic().withBranch(NOTIFICATION_BRANCH)); User subscribedUser = Users.signUpAndSignIn(); Branches.subscribe(topic.getBranch()); Topics.unsubscribe(topic); Users.signIn(topicCreator); Topics.editPost(topic, selectedPost); Users.signIn(subscribedUser); unsubscribeIgnoringFail(Branch branch); Notifications.assertNotificationsOnTopicNotSent(topic, subscribedUser); Notifications.assertNotificationsOnBranchNotSent(topic, subscribedUser); }
Source:
<code>public ReturnState addPartitions(RpcController controller, AddPartitionsProto request) <START> throws ServiceException { <END> TableIdentifierProto identifier = request.getTableIdentifier(); String databaseName = identifier.getDatabaseName(); String tableName = identifier.getTableName(); if (metaDictionary.isSystemDatabase(databaseName)) { throw new ServiceException(databaseName + " is a system database. It does not contain any partitioned tables."); } rlock.lock(); try { boolean contain; contain = store.existDatabase(databaseName); if (contain) { contain = store.existTable(databaseName, tableName); if (contain) { if (store.existPartitionMethod(databaseName, tableName)) { store.addPartitions(databaseName, tableName, request.getPartitionDescList(), request.getIfNotExists()); return OK; } else { return errUndefinedPartitionMethod(tableName); } } else { return errUndefinedTable(tableName); } } else { return errUndefinedDatabase(databaseName); } } catch (Throwable t) { printStackTraceIfError(LOG, t); return returnError(t); } finally { rlock.unlock(); } }</code><technical_language>remove throws ServiceException</technical_language>

Target:
public ReturnState addPartitions(RpcController controller, AddPartitionsProto request) { TableIdentifierProto identifier = request.getTableIdentifier(); String databaseName = identifier.getDatabaseName(); String tableName = identifier.getTableName(); rlock.lock(); try { boolean contain; contain = store.existDatabase(databaseName); if (contain) { contain = store.existTable(databaseName, tableName); if (contain) { if (store.existPartitionMethod(databaseName, tableName)) { store.addPartitions(databaseName, tableName, request.getPartitionDescList(), request.getIfNotExists()); return OK; } else { return errUndefinedPartitionMethod(tableName); } } else { return errUndefinedTable(tableName); } } else { return errUndefinedDatabase(databaseName); } } catch (Throwable t) { printStackTraceIfError(LOG, t); return returnError(t); } finally { rlock.unlock(); } }
Source:
<code>public String getText() { if (linesOfText.length > 0) { String arrayText = String.join("\n", linesOfText); if (text.get().equals("")) { <START> return text.get() + "\n" + arrayText; <END> } return text.get() + arrayText; } else { return text.get(); } }</code><technical_language>In this case text.get() is empty string "" - prepending a newline here? be: java if (text.get().equals("")) { return arrayText; } else { return text.get() + "\n" + arrayText; }</technical_language>

Target:
public String getText() { return String.join("\n", ObjectArrays.concat(text.get(), linesOfText)); }
Source:
<code>public final void setProducer(Producer producer) { producer = onSetProducer(producer); int toRequest = requested; boolean setProducer = false; synchronized (this) { p = producer; if (op != null) { if (toRequest < 0) { setProducer = true; } } } if (setProducer) { op.setProducer(p); } else { p.request(toRequest); } <START> } <END></code><technical_language>Do need safeguards setProducer called multiple times Subscriber is this a valid case</technical_language>

Target:
public final void setProducer(Producer producer) { producer = onSetProducer(producer); int toRequest = requested; boolean setProducer = false; synchronized (this) { p = producer; if (op != null) { if (toRequest == Integer.MIN_VALUE) { setProducer = true; } } } if (setProducer) { op.setProducer(p); } else { if (toRequest == Integer.MIN_VALUE) { p.request(-1); } else { p.request(toRequest); } } }
Source:
<code>private void mockJerseyClient() { MetricRegistry metricRegistry = mock(MetricRegistry.class); when(environment.metrics()).thenReturn(metricRegistry); when(clientFactory.createWithDropwizardClient(any(PaymentGatewayName.class), any(MetricRegistry.class))) .thenReturn(client); WebTarget webTarget = mock(WebTarget.class); <START> when(client.target(any(String.class))).thenReturn(webTarget); when(webTarget.request()).thenReturn(invocationBuilder); when(invocationBuilder.post(any(Entity.class))).thenReturn(response); <END> }</code><technical_language>Is this stubbing more specific? Right now, service gateway account, making basically request</technical_language>

Target:
private void mockJerseyClient() { MetricRegistry metricRegistry = mock(MetricRegistry.class); when(environment.metrics()).thenReturn(metricRegistry); when(clientFactory.createWithDropwizardClient(any(PaymentGatewayName.class), any(MetricRegistry.class))) .thenReturn(client); when(webTarget.request()).thenReturn(invocationBuilder); }
Source:
<code>private void hideKeyboard() { <START> View view = this.getCurrentFocus(); <END> if (view != null) { InputMethodManager inputManager = (InputMethodManager) this.getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }</code><technical_language>Remove unnecessary this</technical_language>

Target:
private void hideKeyboard() { View view = getCurrentFocus(); if (view != null) { InputMethodManager inputManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); inputManager.hideSoftInputFromWindow(view.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } }
Source:
<code>public void start() throws Exception { Preconditions.checkNotNull(config); Preconditions.checkArgument( config.getScheme().startsWith("http") ); LOGGER.info("Neo4jConfiguration.start {}", config); <START> Preconditions.checkNotNull(client); <END> }</code><technical_language>Replace Objects.requireNotNull()</technical_language>

Target:
public void start() throws Exception { Objects.nonNull(config); assertThat("config.getScheme().startsWith(\"http\")", config.getScheme().startsWith("http")); LOGGER.info("Neo4jConfiguration.start {}", config); Objects.nonNull(client); }
Source:
<code>private void store(BinlogPosition newPosition) { if ( newPosition == null ) return; <START> String sql = "INSERT INTO `" + this.schemaDatabaseName + "`.`positions` set " <END> + "server_id = ?, " + "binlog_file = ?, " + "binlog_position = ? " + "ON DUPLICATE KEY UPDATE binlog_file=?, binlog_position=?"; try(Connection c = connectionPool.getConnection() ){ PreparedStatement s = c.prepareStatement(sql); LOGGER.debug("Writing binlog position to " + this.schemaDatabaseName + ".positions: " + newPosition); s.setLong(1, serverID); s.setString(2, newPosition.getFile()); s.setLong(3, newPosition.getOffset()); s.setString(4, newPosition.getFile()); s.setLong(5, newPosition.getOffset()); s.execute(); storedPosition.set(newPosition); } catch ( SQLException e ) { LOGGER.error("received SQLException while trying to save to " + this.schemaDatabaseName + ".positions: "); LOGGER.error(e.getLocalizedMessage()); this.requestStop(); this.exception = e; } }</code><technical_language>of potential SQL injection sites me. instead of substituting in dbName strip explicit db name connect ConnectionPool a db? (if possible...)</technical_language>

Target:
private void store(BinlogPosition newPosition) { if ( newPosition == null ) return; String sql = "INSERT INTO `positions` set " + "server_id = ?, " + "binlog_file = ?, " + "binlog_position = ? " + "ON DUPLICATE KEY UPDATE binlog_file=?, binlog_position=?"; try(Connection c = getConnection() ){ PreparedStatement s = c.prepareStatement(sql); LOGGER.debug("Writing binlog position to " + this.schemaDatabaseName + ".positions: " + newPosition); s.setLong(1, serverID); s.setString(2, newPosition.getFile()); s.setLong(3, newPosition.getOffset()); s.setString(4, newPosition.getFile()); s.setLong(5, newPosition.getOffset()); s.execute(); storedPosition.set(newPosition); } catch ( SQLException e ) { LOGGER.error("received SQLException while trying to save to " + this.schemaDatabaseName + ".positions: "); LOGGER.error(e.getLocalizedMessage()); this.requestStop(); this.exception = e; } }
Source:
<code>private static boolean updateDiskProfileForBackwardCompatibility(DiskImage diskImage, List<DiskProfile> diskProfilesList, Set<Guid> permittedDiskProfilesIds, DbUser user) { if (diskProfilesList.isEmpty()) { return false; <START> } <END> for (DiskProfile diskProfile : diskProfilesList) { if (diskProfilePermitted(diskProfile, permittedDiskProfilesIds, user)) { permittedDiskProfilesIds.add(diskProfile.getId()); diskImage.setDiskProfileId(diskProfile.getId()); return true; } } return false; }</code><technical_language>I drop this check, compiler this optimization anyway.</technical_language>

Target:
private static boolean updateDiskProfileForBackwardCompatibility(DiskImage diskImage, List<DiskProfile> diskProfilesList, Set<Guid> permittedDiskProfilesIds, DbUser user) { for (DiskProfile diskProfile : diskProfilesList) { if (isDiskProfilePermitted(diskProfile, permittedDiskProfilesIds, user)) { permittedDiskProfilesIds.add(diskProfile.getId()); diskImage.setDiskProfileId(diskProfile.getId()); return true; } } return false; }
Source:
<code>public ValueMatcher makeMatcher(ColumnSelectorFactory columnSelectorFactory) { final DimensionSelector dimensionSelector = columnSelectorFactory.makeDimensionSelector(dimension, null); if (dimensionSelector == null) { <START> return new BooleanValueMatcher(Strings.isNullOrEmpty(fn.apply(value))); <END> } else { return new ValueMatcher() { @Override public boolean matches() { final IndexedInts row = dimensionSelector.getRow(); final int size = row.size(); for (int i = 0; i < size; ++i) { if (value.equals(fn.apply(dimensionSelector.lookupName(row.get(i))))) { return true; } } return false; } }; } }</code><technical_language>if a column missing, match in this case? fn.apply(value) a bit unusual is element Range of function Domain. be... return new BooleanValueMatcher(false); @xvrl</technical_language>

Target:
public ValueMatcher makeMatcher(ColumnSelectorFactory columnSelectorFactory) { final DimensionSelector dimensionSelector = columnSelectorFactory.makeDimensionSelector(dimension, null); if (dimensionSelector == null) { return new BooleanValueMatcher(value.equals(Strings.nullToEmpty(fn.apply(null)))); } else { final BitSet bitSetOfIds = new BitSet(dimensionSelector.getValueCardinality()); for (int i = 0; i < dimensionSelector.getValueCardinality(); i++) { if (value.equals(Strings.nullToEmpty(fn.apply(dimensionSelector.lookupName(i))))) { bitSetOfIds.set(i); } } return new ValueMatcher() { @Override public boolean matches() { final IndexedInts row = dimensionSelector.getRow(); final int size = row.size(); for (int i = 0; i < size; ++i) { if (bitSetOfIds.get(row.get(i))) { return true; } } return false; } }; } }
Source:
<code>void setDefaults(final Context context, final String clientId) { sClientId = clientId; sApplicationName = context.getPackageName(); try { sApplicationVersion = context.getPackageManager().getPackageInfo(sApplicationName, 0).versionName; } catch (PackageManager.NameNotFoundException nnfe) { <START> sApplicationVersion = "0.0.0.0"; <END> } sClientIp = "0.0.0.0"; }</code><technical_language>0.0.0.0 [](start = 35, length = 7) put N/A? #Closed</technical_language>

Target:
void setDefaults(final Context context, final String clientId) { sClientId = clientId; sApplicationName = context.getPackageName(); try { sApplicationVersion = context.getPackageManager().getPackageInfo(sApplicationName, 0).versionName; } catch (PackageManager.NameNotFoundException nnfe) { sApplicationVersion = "NA"; } sClientIp = "NA"; try { sDeviceId = StringExtensions.createHash(Secure.getString(context.getContentResolver(), Secure.ANDROID_ID)); } catch (UnsupportedEncodingException | NoSuchAlgorithmException e) { sDeviceId = ""; } if (mDefaultEventCount == 0) { setEvent(EventStrings.APPLICATION_NAME, sApplicationName); setEvent(EventStrings.APPLICATION_VERSION, sApplicationVersion); setEvent(EventStrings.CLIENT_ID, sClientId); setEvent(EventStrings.CLIENT_IP, sClientIp); setEvent(EventStrings.DEVICE_ID, sDeviceId); mDefaultEventCount = mEventList.size(); } }
Source:
<code>public void testOptionalNull() { OptionalModel expected = new OptionalModel(); expected.field = null; <START> OptionalModel result = unmarshal(OptionalModel.class, marshal(expected)); <END> assertThat(result, is(expected)); }</code><technical_language>"{field: null}" remark</technical_language>

Target:
public void testOptionalNull() { OptionalModel expected = new OptionalModel(); OptionalModel result = unmarshal(gson, OptionalModel.class, marshal(gson, expected)); assertThat(result, is(expected)); }
Source:
<code>public void generate(Cube cube, GeneratorStage targetStage) { GeneratorStage stage = cube.getCurrentStage(); if (cube.getTargetStage().precedes(targetStage)) { cube.setTargetStage(targetStage); } if (cube.getCurrentStage().precedes(cube.getTargetStage())) { <START> if (stage instanceof DependencyProvider) { <END> Dependency dependency = ((DependencyProvider) stage).getDependency(cube); if (dependency != null) { Dependent dependent = new Dependent(cube, dependency); this.dependencyManager.register(dependent); if (dependent.isSatisfied()) { stage.getProcessor().processor.add(cube.getAddress()); } } } else { stage.getProcessor().processor.add(cube.getAddress()); } } }</code><technical_language>instanceof check? stages DependencyProviders? (with dependencies default)</technical_language>

Target:
public void generate(Cube cube, GeneratorStage targetStage) { GeneratorStage stage = cube.getCurrentStage(); if (cube.getTargetStage().precedes(targetStage)) { cube.setTargetStage(targetStage); } if (cube.getCurrentStage().precedes(cube.getTargetStage())) { Dependency dependency = stage.getDependency(cube); if (dependency != null) { Dependent dependent = new Dependent(cube, dependency); this.dependencyManager.register(dependent); if (dependent.isSatisfied()) { stage.getProcessor().processor.add(cube.getAddress()); } } else { stage.getProcessor().processor.add(cube.getAddress()); } } }
Source:
<code>public void shouldFitTheSampleSequentialModel() throws Exception { File model = prepareResource("theano_mnist/model.h5"); File features = prepareResource("theano_mnist/x_train.h5"); File labels = prepareResource("theano_mnist/y_train.h5"); EntryPointFitParameters entryPointParameters = EntryPointFitParameters .builder() .modelFilePath(model.getAbsolutePath()) .trainFeaturesFile(features.getAbsolutePath()) .trainLabelsFile(labels.getAbsolutePath()) .batchSize(128) .nbEpoch(2) .type("sequential") <START> .build(); <END> deepLearning4jEntryPoint.fit(entryPointParameters); }</code><technical_language>"sequential" enum</technical_language>

Target:
public void shouldFitTheSampleSequentialModel() throws Exception { final File model = prepareResource("theano_mnist/model.h5"); final Path features = prepareFeatures("theano_mnist"); final Path labels = prepareLabels("theano_mnist"); EntryPointFitParameters entryPointParameters = EntryPointFitParameters .builder() .modelFilePath(model.getAbsolutePath()) .trainFeaturesDirectory(features.toAbsolutePath().toString()) .trainLabelsDirectory(labels.toAbsolutePath().toString()) .batchSize(128) .nbEpoch(2) .type(KerasModelType.SEQUENTIAL) .build(); deepLearning4jEntryPoint.fit(entryPointParameters); }
Source:
<code>protected String[] finalizeScript(ArrayList<String> cmdList) { String[] script; script = new String[cmdList.size() + 4]; script[0] = "stap"; if(getRunLocal() == false) script[script.length-1] = tmpfileName; else script[script.length-1] = fileName; for(int i=0; i< cmdList.size(); i++) { script[i+1] = cmdList.get(i).toString(); } script[script.length-3]="-m"; String modname; if(getRunLocal() == false) { modname = serverfileName.substring(0, serverfileName.indexOf('.')); } else { modname = fileName.substring(fileName.lastIndexOf('/')+1); <START> <END> Pattern validModName = Pattern.compile("^[a-z0-9_]+(.stp)$"); Matcher modNameMatch = validModName.matcher(modname); if(!modNameMatch.find()){ continueRun = false; Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openError(parent, Messages.ScriptRunAction_InvalidScriptTitle, Messages.ScriptRunAction_InvalidScriptTMessage); return new String[0]; } modname = modname.substring(0, modname.indexOf('.')); } if (modname.indexOf('-') != -1) modname = modname.substring(0, modname.indexOf('-')); script[script.length-2]=modname; return script; }</code><technical_language>code moved if/else applies local remote run scripts</technical_language>

Target:
protected String[] finalizeScript(ArrayList<String> cmdList) { String[] script; script = new String[cmdList.size() + 4]; script[0] = "stap"; if(getRunLocal() == false) script[script.length-1] = tmpfileName; else script[script.length-1] = fileName; for(int i=0; i< cmdList.size(); i++) { script[i+1] = cmdList.get(i).toString(); } script[script.length-3]="-m"; String modname; if(getRunLocal() == false) { modname = serverfileName.substring(0, serverfileName.lastIndexOf(".stp")); } else { modname = fileName.substring(fileName.lastIndexOf('/')+1); modname = modname.substring(0, modname.lastIndexOf(".stp")); } Pattern validModName = Pattern.compile("^[a-z0-9_]+$"); Matcher modNameMatch = validModName.matcher(modname); if (!modNameMatch.matches()) { continueRun = false; Shell parent = PlatformUI.getWorkbench().getDisplay() .getActiveShell(); MessageDialog.openError(parent, Messages.ScriptRunAction_InvalidScriptTitle, Messages.ScriptRunAction_InvalidScriptTMessage); return new String[0]; } script[script.length-2]=modname; return script; }
Source:
<code>private String getUnEncryptedValue(String value) { <START> String[] envRefs = StringUtils.substringsBetween(value, "[", "]"); <END> if (envRefs != null && envRefs.length == 1) { return envRefs[0]; } else { return null; } }</code><technical_language>constants defined</technical_language>

Target:
private String getUnEncryptedValue(String value) { String[] unEncryptedRefs = StringUtils.substringsBetween(value, ConfigConstants.SECTION_PREFIX, ConfigConstants.SECTION_SUFFIX); if (unEncryptedRefs != null && unEncryptedRefs.length == 1) { return unEncryptedRefs[0]; } else { return null; } }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append(uuid.toString()); sb.append("|"); sb.append(sessionId); sb.append('|'); sb.append(who); sb.append('|'); sb.append(when); sb.append('|'); sb.append(what); sb.append('|'); sb.append(elapsed); sb.append('|'); if (params != null) { sb.append('['); <START> for (int i = 0; i < params.size(); i++) { <END> if (i > 0) sb.append(','); if(params != null) { Set<String> paramNames = params.keySet(); for (String paramName : paramNames) { sb.append("name="); sb.append(paramName); int numValues = 0; Collection<?> paramValues = params.get(paramName); for (Object paramValue : paramValues) { sb.append(Objects.firstNonNull(paramValue, "null")); if(numValues++ > 0) { sb.append(","); } } } } } sb.append(']'); } sb.append('|'); if (result != null) { sb.append(result); } return sb.toString(); }</code><technical_language>if 3 parameters, include 3 copies of parameters</technical_language>

Target:
public String toString() { return String.format("AuditEvent UUID:%s, SID:%s, TS:%d, who:%s, what:%s", uuid.get(), sessionId, when, who, what); }
Source:
<code>public void createControl(Composite parent) { super.createControl(parent); TreeViewer viewer= getTreeViewer(); viewer.setContentProvider(new SpecfileContentProvider(editor)); IProject project = null; if (input instanceof IFileEditorInput) { IFileEditorInput fileEditorInput= (IFileEditorInput) input; project = fileEditorInput.getFile().getProject(); } <START> if (project!=null) { <END> SpecfileLabelProvider labelProvider = new SpecfileLabelProvider(); labelProvider.setProject(project); viewer.setLabelProvider(labelProvider); } else { viewer.setLabelProvider(new SpecfileLabelProvider()); } viewer.addSelectionChangedListener(this); if (input != null) { viewer.setInput(input); } }</code><technical_language>This SpecfileLabelProvider labelProvider = new SpecfileLabelProvider(); if (project!=null) { labelProvider.setProject(project); } viewer.setLabelProvider(labelProvider);</technical_language>

Target:
public void createControl(Composite parent) { super.createControl(parent); TreeViewer viewer= getTreeViewer(); viewer.setContentProvider(new SpecfileContentProvider(editor)); IProject project = null; if (input instanceof IFileEditorInput) { IFileEditorInput fileEditorInput= (IFileEditorInput) input; project = fileEditorInput.getFile().getProject(); } SpecfileLabelProvider labelProvider = new SpecfileLabelProvider(); if (project!=null) { labelProvider.setProject(project); } viewer.setLabelProvider(labelProvider); viewer.addSelectionChangedListener(this); if (input != null) { viewer.setInput(input); } }
Source:
<code>public void test() throws Exception { assertThat(g.rule(Tree.Kind.FLOW_FUNCTION_TYPE)) .matches("(str: string) => void") .matches("(str: string, number) => void") .matches("() => void") .matches("(string, string,) => void") .matches("(name: string, ...numbers:SomeArrayType) => void") .matches("(name: string, middle?: string) => void") .matches("(string, SomeArrayType) => SomeType") .matches("(await: number) => void") .matches("string => number") <START> .matches("number | string => number") <END> ; }</code><technical_language>@inverno need more tests, model test for parameter clause</technical_language>

Target:
public void test() throws Exception { assertThat(g.rule(Tree.Kind.FLOW_FUNCTION_TYPE)) .matches("(str: string) => void") .matches("(str: string, number) => void") .matches("() => void") .matches("(string, string,) => void") .matches("(name: string, ...numbers:SomeArrayType) => void") .matches("(name: string, middle?: string) => void") .matches("(string, SomeArrayType) => SomeType") .matches("(await: number) => void") .matches("string => number") ; }
Source:
<code>public void sendText(String text) { if (channel == null) { logger.error("Channel is null. Cannot send text."); <START> throw new NullPointerException("Cannot find the channel to write"); <END> } channel.writeAndFlush(new TextWebSocketFrame(text)); }</code><technical_language>thow a NPE</technical_language>

Target:
public void sendText(String text) { if (channel == null) { logger.error("Channel is null. Cannot send text."); throw new IllegalArgumentException("Cannot find the channel to write"); } channel.writeAndFlush(new TextWebSocketFrame(text)); }
Source:
<code>private static ImmutableList<Worker> getWorkerFromZK(Collection<ZkWorker> workers) { return ImmutableList.copyOf( Collections2.transform( <START> workers, <END> new Function<ZkWorker, Worker>() { @Override public Worker apply(ZkWorker input) { return input.getWorker(); } } ) ); }</code><technical_language>I this a lambda (if editing anyway)</technical_language>

Target:
private static ImmutableList<Worker> getWorkerFromZK(Collection<ZkWorker> workers) { return ImmutableList.copyOf(Collections2.transform(workers, ZkWorker::getWorker)); }
Source:
<code>private Object handleTxCommand(TxInvocationContext ctx, TransactionBoundaryCommand command) throws Throwable { Address origin = ctx.isOriginLocal() ? ctx.getOrigin() : ctx.getGlobalTransaction().getAddress(); if (trace) log.tracef("handleTxCommand for command %s, origin %s", command, origin); if (isLocalOnly(command)) { return invokeNextInterceptor(ctx, command); } updateTopologyId(command); int retryTopologyId = -1; Object localResult = null; try { localResult = invokeNextInterceptor(ctx, command); } catch (OutdatedTopologyException e) { retryTopologyId = Math.max(currentTopologyId(), command.getTopologyId() + 1); } boolean async = isTxCommandAsync(command); if (async) { stateTransferManager.forwardCommandIfNeeded(command, getAffectedKeys(ctx, command), origin); return null; } if (ctx.isOriginLocal()) { if (retryTopologyId > 0) { command.setTopologyId(retryTopologyId); waitForTransactionData(retryTopologyId); log.tracef("Retrying command %s for topology %d", command, retryTopologyId); localResult = handleTxCommand(ctx, command); } } else { if (currentTopologyId() > command.getTopologyId()) { if (rollbackOnOldTopologyId((RemoteTxInvocationContext) ctx, command)) { RollbackCommand rollbackCommand = commandsFactory.buildRollbackCommand(command.getGlobalTransaction()); try { invokeNextInterceptor(ctx, rollbackCommand); } catch (Exception e) { } } localResult = UnsureResponse.INSTANCE; } } return localResult; }</code><technical_language>"we ask coordinator retry transaction" - I said, this is true: if a node joined, receive PrepareCommand asynchronously, originator finished sync broadcast, originator retry. Edit: a check in place ignore commands node joined, check work if node "re-joined" a merge</technical_language>

Target:
private Object handleTxCommand(TxInvocationContext ctx, TransactionBoundaryCommand command) throws Throwable { Address origin = ctx.isOriginLocal() ? ctx.getOrigin() : ctx.getGlobalTransaction().getAddress(); if (trace) log.tracef("handleTxCommand for command %s, origin %s", command, origin); if (isLocalOnly(command)) { return invokeNextInterceptor(ctx, command); } updateTopologyId(command); int retryTopologyId = -1; Object localResult = null; try { localResult = invokeNextInterceptor(ctx, command); } catch (OutdatedTopologyException e) { retryTopologyId = Math.max(currentTopologyId(), command.getTopologyId() + 1); } boolean async = isTxCommandAsync(command); if (async) { stateTransferManager.forwardCommandIfNeeded(command, getAffectedKeys(ctx, command), origin); return null; } if (ctx.isOriginLocal()) { if (retryTopologyId > 0) { command.setTopologyId(retryTopologyId); waitForTransactionData(retryTopologyId); log.tracef("Retrying command %s for topology %d", command, retryTopologyId); localResult = handleTxCommand(ctx, command); } } else { if (currentTopologyId() > command.getTopologyId()) { localResult = UnsureResponse.INSTANCE; } } return localResult; }
Source:
<code><START> public static int[] getWeekendDays(Locale locale) { <END> if (thuFryWeekendDaysCountries.contains(locale.getCountry())) { return new int[]{Calendar.THURSDAY, Calendar.FRIDAY}; } else if (frySunWeekendDaysCountries.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SUNDAY}; } else if (fryWeekendDaysCountries.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY}; } else if (sunWeekendDaysCountries.contains(locale.getCountry())) { return new int[]{Calendar.SUNDAY}; } else if (frySatWeekendDaysCountries.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SATURDAY}; } else { return new int[]{Calendar.SATURDAY, Calendar.SUNDAY}; } }</code><technical_language>copy answers stackoverflow. Please rewrite it. <LINK_0></technical_language>

Target:
public static int[] getWeekendDays(Locale locale) { if (THU_FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.THURSDAY, Calendar.FRIDAY}; } else if (FRY_SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SUNDAY}; } else if (FRY_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY}; } else if (SUN_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.SUNDAY}; } else if (FRY_SAT_WEEKEND_DAYS_COUNTRIES.contains(locale.getCountry())) { return new int[]{Calendar.FRIDAY, Calendar.SATURDAY}; } else { return new int[]{Calendar.SATURDAY, Calendar.SUNDAY}; } }
Source:
<code>public List<Versioned<byte[]>> get(ByteArray key, byte[] transforms) throws PersistenceFailureException { StoreUtils.assertValidKey(key); long startTimeNs = -1; if(logger.isTraceEnabled()) startTimeNs = System.nanoTime(); <START> List<Versioned<byte[]>> value = null; <END> try { byte[] result = getRocksDB().get(key.get()); if(result != null) { value = StoreBinaryFormat.fromByteArray(result); } else { return Collections.emptyList(); } } catch(RocksDBException e) { logger.error(e); throw new PersistenceFailureException(e); } finally { if(logger.isTraceEnabled()) { logger.trace("Completed GET (" + getName() + ") from key " + key + " (keyRef: " + System.identityHashCode(key) + ") in " + (System.nanoTime() - startTimeNs) + " ns at " + System.currentTimeMillis()); } } return value; }</code><technical_language>add a mode get() a lock based a config value? (bdb internal config for this mode).. Check BdbStorageEngine</technical_language>

Target:
public List<Versioned<byte[]>> get(ByteArray key, byte[] transforms) throws PersistenceFailureException { StoreUtils.assertValidKey(key); if(enableReadLocks) { synchronized(this.locks.lockFor(key.get())) { return getValueForKey(key, transforms); } } else { return getValueForKey(key, transforms); } }
Source:
<code>protected String getMemento(CTabFolder activeFolder) throws CoreException { Document document = DebugPlugin.newDocument(); Element memoryTabsList = document.createElement(MEMORY_TABS_LIST); int tabCount = 0; for (CTabItem tab : activeFolder.getItems()) { if (getMemoryBlocks(tab).isEmpty()) { continue; } Element memoryTab = document.createElement(MEMORY_TAB); String memorySpace = (String) tab.getData(KEY_MEMORY_SPACE); memoryTab.setAttribute(ATTR_MEMORY_SPACE, memorySpace); IMemoryRenderingType type = (IMemoryRenderingType) tab.getData(KEY_RENDERING_TYPE); memoryTab.setAttribute(ATTR_RENDERING, type.getId()); <START> BigInteger evaluatedAddress = (BigInteger)tab.getData(KEY_EXPRESSION_ADDRESS); <END> memoryTab.setAttribute(ATTR_ADDRESS, HEX_PREFIX + evaluatedAddress.toString(HEX_RADIX)); memoryTabsList.appendChild(memoryTab); tabCount++; } if (tabCount == 0) { return null; } else { document.appendChild(memoryTabsList); return DebugPlugin.serializeDocument(document); } }</code><technical_language>I saving EXPRESSION if here? means memento is saved tab shows expression address, dash, expression. restore expression (and dash :-) present restored</technical_language>

Target:
protected String getMemento(CTabFolder activeFolder) throws CoreException { Document document = DebugPlugin.newDocument(); Element memoryTabsList = document.createElement(MEMORY_TABS_LIST); int tabCount = 0; for (CTabItem tab : activeFolder.getItems()) { if (getMemoryBlocks(tab).isEmpty()) { continue; } Element memoryTab = document.createElement(MEMORY_TAB); String memorySpace = (String) tab.getData(KEY_MEMORY_SPACE); memoryTab.setAttribute(ATTR_MEMORY_SPACE, memorySpace); IMemoryRenderingType type = (IMemoryRenderingType) tab.getData(KEY_RENDERING_TYPE); memoryTab.setAttribute(ATTR_RENDERING, type.getId()); String expression = (String) tab.getData(KEY_EXPRESSION); if (expression != null) { memoryTab.setAttribute(ATTR_ADDRESS, expression); } else { BigInteger evaluatedAddress = (BigInteger) tab.getData(KEY_EXPRESSION_ADDRESS); memoryTab.setAttribute(ATTR_ADDRESS, HEX_PREFIX + evaluatedAddress.toString(HEX_RADIX)); } memoryTabsList.appendChild(memoryTab); tabCount++; } if (tabCount == 0) { return null; } else { document.appendChild(memoryTabsList); return DebugPlugin.serializeDocument(document); } }
Source:
<code>private void composedBlobIdAndDeserialize(short version) throws Exception { String srcUUID = UUID.randomUUID().toString(); String srcBlobIdStr; switch (version) { case BLOB_ID_V1: srcBlobIdStr = <START> buildBlobIdLike(version, null, null, null, null, referencePartitionId, srcUUID.length(), srcUUID); <END> break; case BLOB_ID_V2: srcBlobIdStr = buildBlobIdLike(version, referenceFlag, referenceDatacenterId, referenceAccountId, referenceContainerId, referencePartitionId, srcUUID.length(), srcUUID); break; default: throw new IllegalArgumentException("Invalid version number blob" + version); } deserializeBlobIdAndAssert(version, srcBlobIdStr, referencePartitionId); }</code><technical_language>instance variables for part construct BlobId, introduce a privateMethod takes in non-instance variables version construct BlobId is version</technical_language>

Target:
private void composedBlobIdAndDeserialize(short version) throws Exception { String srcUUID = UUID.randomUUID().toString(); String srcBlobIdStr; srcBlobIdStr = buildBlobIdLike(version, referenceFlag, referenceDatacenterId, referenceAccountId, referenceContainerId, referencePartitionId, srcUUID.length(), srcUUID); deserializeBlobIdAndAssert(version, srcBlobIdStr); }
Source:
<code>default int getMastershipCount() { int count = 0; for (ExportStatsRow st : getStats(false)) { <START> if ("TRUE".equalsIgnoreCase(st.m_exportingRole)) { <END> count++; } } return count; }</code><technical_language>Boolean.parseBoolean(st.m_exportingRole) is essentially this covers</technical_language>

Target:
default int getMastershipCount() { int count = 0; for (ExportStatsRow st : getStats(false)) { if (Boolean.parseBoolean(st.m_exportingRole)) { count++; } } return count; }
Source:
<code>public String[] tensorflowNames() { <START> return new String[] {"EnterZZZZ","ExposeZZZZ"}; <END> }</code><technical_language>Is a solution this? throw a new NoOpNameFoundException? auto skips in place do that</technical_language>

Target:
public String[] tensorflowNames() { throw new NoOpNameFoundException("This operation has no TF counterpart"); }
Source:
<code>public Tokenizer(Reader reader, int cacheBufferSize) { <START> symbols = new UniqueList<TokenizerSymbol>(); <END> token = new TokenizerToken(); upcomingToken = new TokenizerToken(); cacheBuffer = new char[cacheBufferSize]; setReader(reader); }</code><technical_language>this work? Tests</technical_language>

Target:
public Tokenizer(Reader reader, int cacheBufferSize) { symbols = new UniqueList(); token = new TokenizerToken(); upcomingToken = new TokenizerToken(); cacheBuffer = new char[cacheBufferSize]; setReader(reader); }
Source:
<code>public void eventsShouldBeStreamedOnBatchSize() { final long timeout = TimeUnit.SECONDS.toMillis(1); final PartitionData pd = new PartitionData(null, 100L); for (int i = 0; i < 100; ++i) { <START> pd.addEventFromKafka(i + 100L + 1, "test".getBytes()); <END> } assertNull(pd.takeEventsToStream(currentTimeMillis(), 1000, timeout)); final SortedMap<Long, byte[]> eventsToStream = pd.takeEventsToStream(currentTimeMillis(), 99, timeout); assertNotNull(eventsToStream); assertEquals(99, eventsToStream.size()); }</code><technical_language>UTF-8</technical_language>

Target:
public void eventsShouldBeStreamedOnBatchSize() { final long timeout = TimeUnit.SECONDS.toMillis(1); final PartitionData pd = new PartitionData(null, 100L); for (int i = 0; i < 100; ++i) { pd.addEventFromKafka(i + 100L + 1, "test".getBytes(UTF_8)); } assertNull(pd.takeEventsToStream(currentTimeMillis(), 1000, timeout)); final SortedMap<Long, byte[]> eventsToStream = pd.takeEventsToStream(currentTimeMillis(), 99, timeout); assertNotNull(eventsToStream); assertEquals(99, eventsToStream.size()); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { Repository[] repos = getRepositories(event); if (repos.length == 0) return null; GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet(); <START> for (Repository repo : repos) { <END> try { gsdSet.add(new GitSynchronizeData(repo, HEAD, HEAD, true)); } catch (IOException e) { Activator.handleError(e.getMessage(), e, true); } } GitModelSynchronize.launch(gsdSet, getSelectedResources(event)); return null; }</code><technical_language>Style nit: Curlies needed</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Repository[] repos = getRepositories(event); if (repos.length == 0) return null; GitSynchronizeDataSet gsdSet = new GitSynchronizeDataSet(); for (Repository repo : repos) try { gsdSet.add(new GitSynchronizeData(repo, HEAD, HEAD, true)); } catch (IOException e) { Activator.handleError(e.getMessage(), e, true); } GitModelSynchronize.launch(gsdSet, getSelectedResources(event)); return null; }
Source:
<code>public String init() { <START> System.out.println("_YE_OLDE_QUERY_COUNTER_"); END> if ((session.getUser() != null) && (session.getUser().isAuthenticated()) && (session.getUser().isSuperuser())) { authUser = (AuthenticatedUser) session.getUser(); userListMaker = new UserListMaker(userService); runUserSearch(); } else { return permissionsWrapper.notAuthorized(); } return null; }</code><technical_language>cruft removed</technical_language>

Target:
public String init() { if ((session.getUser() != null) && (session.getUser().isAuthenticated()) && (session.getUser().isSuperuser())) { authUser = (AuthenticatedUser) session.getUser(); userListMaker = new UserListMaker(userService); runUserSearch(); } else { return permissionsWrapper.notAuthorized(); } return null; }
Source:
<code>public boolean testProperty(Random random, Entity entityIn) { <START> if (entityIn instanceof IVehicleUser && (((IVehicleUser) entityIn).isRidingVehicle())) { <END> if (((IVehicleUser) entityIn).getVehicle().isPresent()) { VehicleBase vehicle = ((IVehicleUser) entityIn).getVehicle().get(); String vehicleConfigName = vehicle.vehicleType.getConfigName(); return vehicleConfigName.contains(this.testVehicle); } } return false; }</code><technical_language>checking entity instance type, cast entity new IVehicleUser variable reuse variable in subsequent currently ((IVehicleUser) entityIn). code more readable (if of this cast sound good readability in this case)</technical_language>

Target:
public boolean testProperty(Random random, Entity entityIn) { if (entityIn instanceof IVehicleUser) { IVehicleUser vehicleUserEntity = (IVehicleUser) entityIn; if (vehicleUserEntity.isRidingVehicle() && vehicleUserEntity.getVehicle().isPresent()) { VehicleBase vehicle = vehicleUserEntity.getVehicle().get(); String vehicleConfigName = vehicle.vehicleType.getConfigName(); return vehicleConfigName.contains(testVehicle); } } return false; }
Source:
<code>private void exportWithInvalidScaleLevel(Integer scaleLevel) throws Exception { String outputPath = "/" + TEMPORARY_PROJECT_NAME + "/" + IMAGE_FILE_NAME + ImageFileFormat.PNG.getName().toLowerCase(); try { ExportAction exportAction = new ExportAction(session, Collections.singletonList(getRepresentation()), new Path(outputPath), ImageFileFormat.PNG, false, true); exportAction.setDiagramScaleLevel(scaleLevel); <START> fail("The export should throw an IllegalArgumentException because the scale level is invalid."); <END> } catch (IllegalArgumentException iae) { assertEquals("The scale level must be a percentage (between 0 to 100).", iae.getMessage()); } catch (Exception e) { fail("The export should throw an IllegalArgumentException because the scale level is invalid."); } }</code><technical_language>create a local variable mutualize string</technical_language>

Target:
private void exportWithInvalidScaleLevel(Integer scaleLevel) throws Exception { String outputPath = "/" + TEMPORARY_PROJECT_NAME + "/" + IMAGE_FILE_NAME + ImageFileFormat.PNG.getName().toLowerCase(); String failureMessage = "The export should throw an IllegalArgumentException because the scale level is invalid."; try { ExportAction exportAction = new ExportAction(session, Collections.singletonList(getRepresentation()), new Path(outputPath), ImageFileFormat.PNG, false, true); exportAction.setDiagramScaleLevel(scaleLevel); fail(failureMessage); } catch (IllegalArgumentException iae) { assertEquals("The scale level must be a percentage (between 0 to 100).", iae.getMessage()); } catch (Exception e) { fail(failureMessage); } }
Source:
<code>public ThriftIndexHandle( @JsonProperty("schemaTableName") SchemaTableName schemaTableName, @JsonProperty("tupleDomain") TupleDomain<ColumnHandle> tupleDomain) { this.schemaTableName = requireNonNull(schemaTableName, "schemaTableName is null"); this.tupleDomain = requireNonNull(tupleDomain, "tupleDomain is null"); <START> this.session = Optional.empty(); <END> }</code><technical_language>Is this workers</technical_language>

Target:
public ThriftIndexHandle( @JsonProperty("schemaTableName") SchemaTableName schemaTableName, @JsonProperty("tupleDomain") TupleDomain<ColumnHandle> tupleDomain) { this(schemaTableName, tupleDomain, Optional.empty()); }