auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { <START> if (mIsFeed) { <END> Intent feedListIntent = ReaderActivityLauncher.getReaderFeedPreviewIntent(this, mBlogId); if (NavUtils.shouldUpRecreateTask(this, feedListIntent) || isTaskRoot()) { TaskStackBuilder.create(this) .addNextIntentWithParentStack(feedListIntent) .startActivities(); return true; } } onBackPressed(); return true; } return super.onOptionsItemSelected(item); }</code><technical_language>Oh, I this is now. user hits button while viewing a feed item, this shows feed preview. I this works - unexpected returned a view start from. I more sense simply return browser, barring show main activity of WPAndroid</technical_language>

Target:
public boolean onOptionsItemSelected(final MenuItem item) { if (item.getItemId() == android.R.id.home) { onBackPressed(); return true; } return super.onOptionsItemSelected(item); }
Source:
<code>public void testWriteWithOldSchema() throws IOException { fsWriter = newWriter(testDirectory, SCHEMA); init(fsWriter); FileStatus[] stats = fs.listStatus(testDirectory, PathFilters.notHidden()); Assert.assertEquals("Should contain no visible files", 0, stats.length); stats = fs.listStatus(testDirectory); Assert.assertEquals("Should contain a hidden file", 1, stats.length); List<Record> written = Lists.newArrayList(); for (long i = 0; i < 10000; i += 1) { Record record = record(i, "test-" + i); fsWriter.write(record); written.add(record); } stats = fs.listStatus(testDirectory, PathFilters.notHidden()); Assert.assertEquals("Should contain no visible files", 0, stats.length); stats = fs.listStatus(testDirectory); Assert.assertEquals("Should contain a hidden file", 1, stats.length); fsWriter.close(); stats = fs.listStatus(testDirectory, PathFilters.notHidden()); Assert.assertEquals("Should contain a visible data file", 1, stats.length); <START> DatasetReader<Record> reader = newReader(stats[0].getPath(), TEST_SCHEMA); <END> Assert.assertEquals("Should match written records", written, Lists.newArrayList((Iterator) init(reader))); }</code><technical_language>This fail SCHEMA compatible TEST_SCHEMA; message field is required for latter, missing in "old" schema. I need understand this schema passed read schema</technical_language>

Target:
public void testWriteWithOldSchema() throws IOException { Schema writerSchema = SchemaBuilder.record("Message").fields() .requiredLong("id") .requiredString("message") .endRecord(); fsWriter = newWriter(testDirectory, TEST_SCHEMA, writerSchema); init(fsWriter); for (long i = 0; i < 1000; i += 1) { GenericRecordBuilder recordBuilder = new GenericRecordBuilder(TEST_SCHEMA) .set("id", i).set("message","test-"+ i); fsWriter.write(recordBuilder.build()); } fsWriter.close(); final FileStatus[] stats = fs.listStatus(testDirectory, PathFilters.notHidden()); Assert.assertEquals("Should match with writer schema", writerSchema, FileSystemUtil.schema("record", fs, stats[0].getPath())); }
Source:
<code>public boolean conforms() { <START> long max_dist = in().dimension(0) * in().dimension(0) + in().dimension(1) * in().dimension(1) <END> + in().dimension(2) * in().dimension(2); System.out.println(max_dist); return ((in().numDimensions() == 3) && (max_dist <= Integer.MAX_VALUE)); }</code><technical_language>in 2D case size of tmp[][][]</technical_language>

Target:
public boolean conforms() { if (in().numDimensions() == 3) { long max_dist = in().dimension(0) * in().dimension(0) + in().dimension(1) * in().dimension(1) + in().dimension(2) * in().dimension(2); return ((in().numDimensions() == 3) && (max_dist <= Integer.MAX_VALUE)); } return false; }
Source:
<code>public void removeSyncNotificationLatch(Cache<K, V> cache, K key, V value, CountDownLatch latch) { EventSource<K, V> eventSourceKey = new EventSource<K, V>(cache, key, value); Queue<CountDownLatch> latches = latchesByEventSource.get(eventSourceKey); if (latches == null) { return; } latches.remove(latch); if (latches.isEmpty()) { <START> latchesByEventSource.remove(eventSourceKey, EMPTY_QUEUE); <END> } }</code><technical_language>This remove anything</technical_language>

Target:
public void removeSyncNotificationLatch(Cache<K, V> cache, K key, V value, CountDownLatch latch) { EventSource<K, V> eventSourceKey = new EventSource<K, V>(cache, key, value); Queue<CountDownLatch> latches = latchesByEventSource.get(eventSourceKey); if (latches == null) { return; } latchesByEventSource.compute(eventSourceKey, (kvEventSource, countDownLatches) -> { countDownLatches.remove(latch); return countDownLatches.isEmpty() ? null : countDownLatches; }); }
Source:
<code>protected FileDescriptor connectToKernel() throws ErrnoException, SocketException { <START> FileDescriptor fd <END> = Os.socket(AF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_INET_DIAG); Os.connect(fd, SocketUtils.makeNetlinkSocketAddress(0 , 0 )); return fd; }</code><technical_language>final inline</technical_language>

Target:
protected FileDescriptor connectToKernel() throws ErrnoException, SocketException { final FileDescriptor fd = Os.socket(AF_NETLINK, SOCK_DGRAM | SOCK_CLOEXEC, NETLINK_INET_DIAG); Os.connect(fd, SocketUtils.makeNetlinkSocketAddress(0 , 0 )); return fd; }
Source:
<code>public static String getDensityString(DisplayMetrics displayMetrics) { switch (displayMetrics.densityDpi) { case DisplayMetrics.DENSITY_LOW: return "ldpi"; case DisplayMetrics.DENSITY_MEDIUM: return "mdpi"; case DisplayMetrics.DENSITY_TV: return "tvdpi"; case DisplayMetrics.DENSITY_HIGH: return "hdpi"; case DisplayMetrics.DENSITY_280: return "xhdpi"; case DisplayMetrics.DENSITY_XHIGH: <START> return "xhdpi"; <END> case DisplayMetrics.DENSITY_360: return "xxhdpi"; case DisplayMetrics.DENSITY_400: return "xxhdpi"; case DisplayMetrics.DENSITY_420: return "xxhdpi"; case DisplayMetrics.DENSITY_XXHIGH: return "xxhdpi"; case DisplayMetrics.DENSITY_560: return "xxxhdpi"; case DisplayMetrics.DENSITY_XXXHIGH: return "xxxhdpi"; case DisplayMetrics.DENSITY_TV: return "tvdpi"; default: return "unknown"; } }</code><technical_language>fall-through cases clean this up: java case DisplayMetrics.DENSITY_280: case DisplayMetrics.DENSITY_XHIGH: return "xhdpi"; etc</technical_language>

Target:
public static String getDensityString(DisplayMetrics displayMetrics) { switch (displayMetrics.densityDpi) { case DisplayMetrics.DENSITY_LOW: return "ldpi"; case DisplayMetrics.DENSITY_MEDIUM: return "mdpi"; case DisplayMetrics.DENSITY_TV: return "tvdpi"; case DisplayMetrics.DENSITY_HIGH: return "hdpi"; case DisplayMetrics.DENSITY_280: case DisplayMetrics.DENSITY_XHIGH: return "xhdpi"; case DisplayMetrics.DENSITY_360: case DisplayMetrics.DENSITY_400: case DisplayMetrics.DENSITY_420: case DisplayMetrics.DENSITY_XXHIGH: return "xxhdpi"; case DisplayMetrics.DENSITY_560: case DisplayMetrics.DENSITY_XXXHIGH: return "xxxhdpi"; default: return "unknown"; } }
Source:
<code>public Completable asRxCompletable() { <START> throwExceptionIfRxJavaIsNotAvailable("asRxCompetable()"); <END> return Completable .create(OnSubscribeExecuteAsBlockingCompletable.newInstance(this)) .subscribeOn(Schedulers.io()); }</code><technical_language>p is missing in exception message :)</technical_language>

Target:
public Completable asRxCompletable() { throwExceptionIfRxJavaIsNotAvailable("asRxCompletable()"); return Completable .create(OnSubscribeExecuteAsBlockingCompletable.newInstance(this)) .subscribeOn(Schedulers.io()); }
Source:
<code>BulkSlotProviderImpl( final SlotSelectionStrategy slotSelectionStrategy, final SlotPool slotPool, final PhysicalSlotRequestBulkChecker slotRequestBulkChecker) { this.slotSelectionStrategy = checkNotNull(slotSelectionStrategy); this.slotPool = checkNotNull(slotPool); <START> this.slotRequestBulkChecker = slotRequestBulkChecker; <END> }</code><technical_language>null checks consistent in this class</technical_language>

Target:
public BulkSlotProviderImpl( final SlotSelectionStrategy slotSelectionStrategy, final SlotPool slotPool, final PhysicalSlotRequestBulkChecker slotRequestBulkChecker) { this.slotSelectionStrategy = checkNotNull(slotSelectionStrategy); this.slotPool = checkNotNull(slotPool); this.slotRequestBulkChecker = checkNotNull(slotRequestBulkChecker); }
Source:
<code>public String openSession(SessionContext session) throws SqlExecutionException { <START> return null; <END> }</code><technical_language>Is this a valid return value? is throw UnsupportedOperationException instead of returning null</technical_language>

Target:
public String openSession(SessionContext session) throws SqlExecutionException { return session.getSessionId(); }
Source:
<code>public void anAlarmNotificationIsReceivedFromAnUnknownDevice(final Map<String, String> settings) throws Throwable { try { final String deviceIdentification = getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION); SimulatePushedAlarmsHooks.simulateAlarm(deviceIdentification, new byte[] { 0x2C, 0x00, 0x00, 0x01, 0x02 }, this.serviceEndpoint.getAlarmNotificationsHost(), this.serviceEndpoint.getAlarmNotificationsPort()); SimulatePushedAlarmsHooks.simulateAlarm(deviceIdentification, new byte[] { 0x2C, 0x04, 0x20, 0x00, 0x00 }, this.serviceEndpoint.getAlarmNotificationsHost(), this.serviceEndpoint.getAlarmNotificationsPort()); } catch (final Exception e) { <START> LOGGER.error("Error occured simulateAlarm: ", e); <END> } }</code><technical_language>Proposal: "Error occured simulate alarm: "</technical_language>

Target:
public void anAlarmNotificationIsReceivedFromAnUnknownDevice(final Map<String, String> settings) throws Throwable { try { final String deviceIdentification = getString(settings, PlatformKeys.KEY_DEVICE_IDENTIFICATION, PlatformDefaults.DEFAULT_DEVICE_IDENTIFICATION); SimulatePushedAlarmsHooks.simulateAlarm(deviceIdentification, new byte[] { 0x2C, 0x00, 0x00, 0x01, 0x02 }, this.serviceEndpoint.getAlarmNotificationsHost(), this.serviceEndpoint.getAlarmNotificationsPort()); SimulatePushedAlarmsHooks.simulateAlarm(deviceIdentification, new byte[] { 0x2C, 0x04, 0x20, 0x00, 0x00 }, this.serviceEndpoint.getAlarmNotificationsHost(), this.serviceEndpoint.getAlarmNotificationsPort()); } catch (final Exception e) { LOGGER.error("Error occured simulating an alarm", e); } }
Source:
<code>private boolean isValidRecord(boolean isBinary, boolean isPositive, ColumnConfig columnConfig) { if(isBinary) { return columnConfig != null && (columnConfig.isCategorical() || modelConfig.getBinningAlgorithm().equals(ModelStatsConf.BinningAlgorithm.DynamicBinning) || modelConfig.getBinningMethod().equals(BinningMethod.EqualTotal) || modelConfig.getBinningMethod().equals(BinningMethod.EqualInterval) || (modelConfig.getBinningMethod().equals(BinningMethod.EqualPositive) && isPositive) || (modelConfig.getBinningMethod().equals(BinningMethod.EqualNegtive) && !isPositive) || modelConfig.getBinningMethod().equals(BinningMethod.WeightTotal) || modelConfig.getBinningMethod().equals(BinningMethod.WeightInterval) || (modelConfig.getBinningMethod().equals(BinningMethod.WeightPositive) && isPositive) || (modelConfig.getBinningMethod().equals(BinningMethod.WeightNegative) && !isPositive)); <START> } else { <END> return columnConfig != null && ( columnConfig.isCategorical() || modelConfig.getBinningMethod().equals(BinningMethod.EqualTotal) || modelConfig.getBinningMethod().equals(BinningMethod.EqualInterval) || modelConfig.getBinningMethod().equals(BinningMethod.WeightTotal) || modelConfig.getBinningMethod().equals(BinningMethod.WeightInterval)); } }</code><technical_language>please redefine a function for complex boolean expression</technical_language>

Target:
private boolean isValidRecord(boolean isBinary, boolean isPositive, ColumnConfig columnConfig) { if(isBinary) { return columnConfig != null && (columnConfig.isCategorical() || isValidBinningMethodForBinary(isPositive)); } else { return columnConfig != null && (columnConfig.isCategorical() || isValidBinningMethod()); } }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + ((context == null) ? 0 : context.hashCode()); result = (prime * result) + ((fields == null) ? 0 : fields.hashCode()); result = (prime * result) + ((id == null) ? 0 : id.hashCode()); result = (prime * result) + ((name == null) ? 0 : name.hashCode()); <START> result = (prime * result) + ((stream == null) ? 0 : stream.hashCode()); <END> return result; }</code><technical_language>needs consider customAttributes</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = (prime * result) + ((context == null) ? 0 : context.hashCode()); result = (prime * result) + ((fields == null) ? 0 : fields.hashCode()); result = (prime * result) + ((id == null) ? 0 : id.hashCode()); result = (prime * result) + ((name == null) ? 0 : name.hashCode()); result = (prime * result) + ((stream == null) ? 0 : stream.hashCode()); result = (prime * result) + ((customAttributes == null) ? 0 : customAttributes.hashCode()); return result; }
Source:
<code>public static void setupTracingConfig() { List<String> descriptors = new ArrayList<>(); addDescriptor(descriptors, BigtableTableAdminGrpc.getServiceDescriptor()); addDescriptor(descriptors, BigtableGrpc.getServiceDescriptor()); boolean usingBigtableHBase = false; try { Class.forName("com.google.cloud.bigtable.hbase.BigtableTable"); usingBigtableHBase = true; } catch (ClassNotFoundException e) { <START> } <END> if (usingBigtableHBase) { descriptors.addAll(Arrays.asList( "BigtableTable.getTableDescriptor", "BigtableTable.exists", "BigtableTable.existsAll", "BigtableTable.batch", "BigtableTable.batchCallback", "BigtableTable.get", "BigtableTable.put", "BigtableTable.checkAndPut", "BigtableTable.delete", "BigtableTable.checkAndDelete", "BigtableTable.checkAndMutate", "BigtableTable.mutateRow", "BigtableTable.append", "BigtableTable.increment", "BigtableTable.incrementColumnValue" )); } Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(descriptors); Tracing.getTraceConfig().updateActiveTraceParams( TraceParams.DEFAULT.toBuilder().setSampler(Samplers.probabilitySampler(0.1)).build()); }</code><technical_language>This feels kinda hacky. hbase client TracingUtility registers methods (possibly delegating addDescriptor)</technical_language>

Target:
public static void setupTracingConfig() { List<String> descriptors = new ArrayList<>(); addDescriptor(descriptors, BigtableTableAdminGrpc.getServiceDescriptor()); addDescriptor(descriptors, BigtableGrpc.getServiceDescriptor()); Tracing.getExportComponent().getSampledSpanStore().registerSpanNamesForCollection(descriptors); }
Source:
<code>public void getState_throwOnClosedSession() { SyncUser user = UserFactory.createUniqueUser(Constants.AUTH_URL); SyncConfiguration syncConfiguration = configFactory .createSyncConfigurationBuilder(user, Constants.SYNC_SERVER_URL) .waitForInitialRemoteData() .build(); Realm realm = Realm.getInstance(syncConfiguration); SyncSession session = SyncManager.getSession(syncConfiguration); realm.close(); user.logout(); thrown.expect(IllegalStateException.class); <START> thrown.expectMessage("Could not find session, Realm was probably closed"); <END> session.getState(); }</code><technical_language>session inactive state of force user close Realms logout</technical_language>

Target:
public void getState_throwOnClosedSession() { SyncUser user = UserFactory.createUniqueUser(Constants.AUTH_URL); SyncConfiguration syncConfiguration = configFactory .createSyncConfigurationBuilder(user, Constants.SYNC_SERVER_URL) .build(); Realm realm = Realm.getInstance(syncConfiguration); SyncSession session = SyncManager.getSession(syncConfiguration); realm.close(); user.logout(); thrown.expect(IllegalStateException.class); thrown.expectMessage("Could not find session, Realm was probably closed"); session.getState(); }
Source:
<code>public List<Vo> getVosWhereUserIsAdmin(PerunSession sess, User user) throws InternalErrorException { try { return jdbc.query("select " + VosManagerImpl.voMappingSelectQuery + " from authz join vos on authz.vo_id=vos.id " + " left outer join groups_members on groups_members.group_id=authz.authorized_group_id " + " left outer join members on members.id=groups_members.member_id " + <START> " where (authz.user_id=? or members.user_id=?) and authz.role_id=(select id from roles where name='voadmin')", <END> VosManagerImpl.VO_MAPPER, user.getId(), user.getId()); } catch (EmptyResultDataAccessException e) { return new ArrayList<Vo>(); } catch (RuntimeException e) { throw new InternalErrorException(e); } }</code><technical_language>Please replace this direct string 'voadmin' for ? argument Role.VOADMIN</technical_language>

Target:
public List<Vo> getVosWhereUserIsAdmin(PerunSession sess, User user) throws InternalErrorException { try { return jdbc.query("select " + VosManagerImpl.voMappingSelectQuery + " from authz join vos on authz.vo_id=vos.id " + " left outer join groups_members on groups_members.group_id=authz.authorized_group_id " + " left outer join members on members.id=groups_members.member_id " + " where (authz.user_id=? or members.user_id=?) and authz.role_id=(select id from roles where name=?)", VosManagerImpl.VO_MAPPER, user.getId(), user.getId(), Role.VOADMIN.getRoleName()); } catch (EmptyResultDataAccessException e) { return new ArrayList<Vo>(); } catch (RuntimeException e) { throw new InternalErrorException(e); } }
Source:
<code>private static void appendStatsField(StringBuilder rewrittenQueryBuilder, HiveConf conf, ColumnStatsField columnStatsField, ColumnStatsType columnStatsType, String columnName, int pos) throws SemanticException { switch (columnStatsField) { case COLUMN_TYPE: appendColumnType(rewrittenQueryBuilder, conf, columnStatsType, pos); break; case COUNT_TRUES: appendCountTrues(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_FALSES: appendCountFalses(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_NULLS: appendCountNulls(rewrittenQueryBuilder, conf, columnName, pos); break; <START> case MIN: <END> appendMin(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case MAX: appendMax(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case NDV: appendNDV(rewrittenQueryBuilder, conf, columnName, pos); break; case BITVECTOR: appendBitVector(rewrittenQueryBuilder, conf, columnName, pos); break; case MAX_LENGTH: appendMaxLength(rewrittenQueryBuilder, conf, columnName, pos); break; case AVG_LENGTH: appendAvgLength(rewrittenQueryBuilder, conf, columnName, pos); break; default: throw new SemanticException("Not supported field " + columnStatsField); } }</code><technical_language>I sense organize column types - other side type based stuff next other...here calc based split worth effort.</technical_language>

Target:
private static void appendStatsField(StringBuilder rewrittenQueryBuilder, HiveConf conf, ColumnStatsField columnStatsField, ColumnStatsType columnStatsType, String columnName, int pos) throws SemanticException { switch (columnStatsField) { case COLUMN_STATS_TYPE: appendColumnType(rewrittenQueryBuilder, conf, columnStatsType, pos); break; case COUNT_TRUES: appendCountTrues(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_FALSES: appendCountFalses(rewrittenQueryBuilder, conf, columnName, pos); break; case COUNT_NULLS: appendCountNulls(rewrittenQueryBuilder, conf, columnName, pos); break; case MIN: appendMin(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case MAX: appendMax(rewrittenQueryBuilder, conf, columnStatsType, columnName, pos); break; case NDV: appendNDV(rewrittenQueryBuilder, conf, columnName, pos); break; case BITVECTOR: appendBitVector(rewrittenQueryBuilder, conf, columnName, pos); break; case MAX_LENGTH: appendMaxLength(rewrittenQueryBuilder, conf, columnName, pos); break; case AVG_LENGTH: appendAvgLength(rewrittenQueryBuilder, conf, columnName, pos); break; default: throw new SemanticException("Not supported field " + columnStatsField); } }
Source:
<code>private void setItemEnabled(Menu menu, int menuId, boolean isEnabled, boolean isVisible) { final MenuItem item = menu.findItem(menuId); <START> if (item == null || item.isEnabled() == isEnabled) <END> return; item.setVisible(isVisible); item.setEnabled(isEnabled); if (item.getIcon() != null) { Drawable icon = item.getIcon().mutate(); icon.setAlpha(isEnabled ? 255 : 128); item.setIcon(icon); } }</code><technical_language>check isVisible here</technical_language>

Target:
private void setItemEnabled(Menu menu, int menuId, boolean isEnabled, boolean isVisible) { final MenuItem item = menu.findItem(menuId); if (item == null || (item.isEnabled() == isEnabled && item.isVisible() == isVisible)) return; item.setVisible(isVisible); item.setEnabled(isEnabled); if (item.getIcon() != null) { Drawable icon = item.getIcon().mutate(); icon.setAlpha(isEnabled ? 255 : 128); item.setIcon(icon); } }
Source:
<code>public FunctionBlock(String name, Type type, CustomUIPane pane) { super(pane); this.name = new SimpleStringProperty(name); this.loadFXML("FunctionBlock"); ArrayList<String> args = new ArrayList<>(); Type t = type; while (t instanceof FuncT) { FuncT ft = (FuncT) t; args.add(ft.getArgs()[0].toHaskellType()); t = ft.getArgs()[1]; } List<Type> inputSignatures = new ArrayList<>(); Type functionSignature = getFunctionSignature(); for (int i = 0; i < args.size(); i++) { if (functionSignature instanceof FuncT) { Type inputSignature = BackendUtils.dive((FuncT) functionSignature, i + 1); inputSignatures.add(inputSignature); } else { throw new FunctionDefinitionException(); } <START> } <END> argumentSpace = new ArgumentSpace(this, inputSignatures); argumentSpace.setKnotIndex(getAllInputs().size()); ((Pane) this.lookup("#nestSpace")).getChildren().add(argumentSpace); argumentSpace.knotIndexProperty().addListener(e -> invalidateKnotIndex()); output = new OutputAnchor(this); output.layoutXProperty().bind(outputSpace.widthProperty().divide(2)); outputSpace.getChildren().add(output); Pane functionInfo = (Pane) this.lookup("#functionInfo"); this.prefWidthProperty().bind(functionInfo.widthProperty().add(argumentSpace.prefWidthProperty())); this.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); this.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); functionInfo.setMinWidth(Region.USE_PREF_SIZE); functionInfo.setMaxWidth(Region.USE_PREF_SIZE); invalidateConnectionState(); }</code><technical_language>this loop basically loop it</technical_language>

Target:
public FunctionBlock(String name, Type type, CustomUIPane pane) { super(pane); this.name = new SimpleStringProperty(name); this.loadFXML("FunctionBlock"); ArrayList<String> args = new ArrayList<>(); Type t = type; while (t instanceof FuncT) { FuncT ft = (FuncT) t; args.add(ft.getArgs()[0].toHaskellType()); t = ft.getArgs()[1]; } List<Type> inputSignatures = new ArrayList<>(); Type functionSignature = getFunctionSignature(); for (int i = 0; i < args.size(); i++) { if (functionSignature instanceof FuncT) { Type inputSignature = BackendUtils.dive((FuncT) functionSignature, i + 1); inputSignatures.add(inputSignature); } else { throw new FunctionDefinitionException(); } } argumentSpace = new ArgumentSpace(this, inputSignatures); argumentSpace.setKnotIndex(getAllInputs().size()); nestSpace.getChildren().add(argumentSpace); argumentSpace.knotIndexProperty().addListener(e -> invalidateKnotIndex()); output = new OutputAnchor(this); outputSpace.setCenter(output); this.prefWidthProperty().bind(functionInfo.widthProperty().add(argumentSpace.prefWidthProperty())); this.setMinSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); this.setMaxSize(Region.USE_PREF_SIZE, Region.USE_PREF_SIZE); functionInfo.setMinWidth(Region.USE_PREF_SIZE); functionInfo.setMaxWidth(Region.USE_PREF_SIZE); invalidateConnectionState(); }
Source:
<code>void setAndGetSessionState(MessagingEntityType entityType) { setSenderAndReceiver(entityType, 0, true); <START> receiver = receiverMono.block(TIMEOUT); <END> final byte[] sessionState = "Finished".getBytes(UTF_8); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage messageToSend = getMessage(messageId, true); sendMessage(messageToSend).block(Duration.ofSeconds(10)); AtomicReference<ServiceBusReceivedMessage> receivedMessage = new AtomicReference<>(); StepVerifier.create(receiver.receiveMessages() .take(1) .flatMap(message -> { logger.info("SessionId: {}. LockToken: {}. LockedUntil: {}. Message received.", message.getSessionId(), message.getLockToken(), message.getLockedUntil()); receivedMessage.set(message); return receiver.setSessionState(sessionState); })) .expectComplete() .verify(); StepVerifier.create(receiver.getSessionState()) .assertNext(state -> { logger.info("State received: {}", new String(state, UTF_8)); assertArrayEquals(sessionState, state); }) .verifyComplete(); receiver.complete(receivedMessage.get()).block(Duration.ofSeconds(15)); messagesPending.decrementAndGet(); }</code><technical_language>disposing of original receiver setting again</technical_language>

Target:
void setAndGetSessionState(MessagingEntityType entityType) { setSenderAndReceiver(entityType, 0, true); final byte[] sessionState = "Finished".getBytes(UTF_8); final String messageId = UUID.randomUUID().toString(); final ServiceBusMessage messageToSend = getMessage(messageId, true); sendMessage(messageToSend).block(Duration.ofSeconds(10)); AtomicReference<ServiceBusReceivedMessage> receivedMessage = new AtomicReference<>(); StepVerifier.create(receiver.receiveMessages() .take(1) .flatMap(message -> { logger.info("SessionId: {}. LockToken: {}. LockedUntil: {}. Message received.", message.getSessionId(), message.getLockToken(), message.getLockedUntil()); receivedMessage.set(message); return receiver.setSessionState(sessionState); })) .expectComplete() .verify(); StepVerifier.create(receiver.getSessionState()) .assertNext(state -> { logger.info("State received: {}", new String(state, UTF_8)); assertArrayEquals(sessionState, state); }) .verifyComplete(); receiver.complete(receivedMessage.get()).block(Duration.ofSeconds(15)); messagesPending.decrementAndGet(); }
Source:
<code>public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::checkSecurityOr403); before("/*", mimeType, this::checkSecurityOr403); get("", mimeType, this::index); get(Routes.AgentsAPI.UUID, mimeType, this::show); patch(Routes.AgentsAPI.UUID, mimeType, this::update); patch("", mimeType, this::bulkUpdate); delete(Routes.AgentsAPI.UUID, mimeType, this::deleteAgent); delete("", mimeType, this::bulkDeleteAgents); <START> exception(HttpException.class, this::httpException); <END> }); }</code><technical_language>need add a HttpException handler controller (anymore). part of <LINK_0> commit, added a top-level handler removed individual controllers</technical_language>

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("/*", mimeType, this::setContentType); before("", mimeType, this::checkSecurityOr403); before("/*", mimeType, this::checkSecurityOr403); get("", mimeType, this::index); get(Routes.AgentsAPI.UUID, mimeType, this::show); patch(Routes.AgentsAPI.UUID, mimeType, this::update); patch("", mimeType, this::bulkUpdate); delete(Routes.AgentsAPI.UUID, mimeType, this::deleteAgent); delete("", mimeType, this::bulkDeleteAgents); }); }
Source:
<code>public String translate(final With with) { final List<ImmutablePair<Name, Expression>> withs = with.getWiths(); withs.forEach(aWith -> { injector.injectMembers(aWith.getLeft()); injector.injectMembers(aWith.getRight()); }); final String withStatements = withs.stream() .map(aWith -> aWith.getLeft().translate() + " AS (" + aWith.getRight().translate() + ")") .collect(Collectors.joining(", ")); final Expression then = with.getThen(); <START> if (then != null) { <END> inject(then); return String.format("WITH %s %s", withStatements, then.translate()); } else { return String.format("WITH %s", withStatements); } }</code><technical_language>sense a "then"? is example usage of that</technical_language>

Target:
public String translate(final With with) { final List<ImmutablePair<Name, Expression>> clauses = with.getClauses(); clauses.forEach(clause -> { injector.injectMembers(clause.getLeft()); injector.injectMembers(clause.getRight()); }); final String withStatements = clauses.stream() .map(clause -> clause.getLeft().translate() + " AS (" + clause.getRight().translate() + ")") .collect(Collectors.joining(", ")); final Expression then = with.getThen(); if (then != null) { inject(then); return String.format("WITH %s %s", withStatements, then.translate()); } else { return String.format("WITH %s", withStatements); } }
Source:
<code>public void jobsUpdated(Map<Integer, Job> jobs) { List<Integer> selectedJobsIds = this.controller.getModel().getSelectedJobsIds(); this.ds.invalidateCache(); RecordList data = new RecordList(); for (Job j : jobs.values()) { JobRecord jobRecord = new JobRecord(j); this.columnsFactory.buildRecord(j, jobRecord); data.add(jobRecord); if (selectedJobsIds != null && selectedJobsIds.contains(j.getId())) { jobRecord.setAttribute("isSelected", true); } } this.ds.setCacheData(data.toArray()); data.destroy(); applyCurrentLocalFilter(); if (!isJobFromUrlAutoSelected && selectJobIdFromUrl()) { isJobFromUrlAutoSelected = true; <START> LogModel.getInstance().logImportantMessage("isJobFromUrlAutoSelected = false"); <END> } }</code><technical_language>is this log important</technical_language>

Target:
public void jobsUpdated(Map<Integer, Job> jobs) { List<Integer> selectedJobsIds = this.controller.getModel().getSelectedJobsIds(); this.ds.invalidateCache(); RecordList data = new RecordList(); for (Job j : jobs.values()) { JobRecord jobRecord = new JobRecord(j); this.columnsFactory.buildRecord(j, jobRecord); data.add(jobRecord); if (selectedJobsIds != null && selectedJobsIds.contains(j.getId())) { jobRecord.setAttribute("isSelected", true); } } this.ds.setCacheData(data.toArray()); data.destroy(); applyCurrentLocalFilter(); if (!isJobFromUrlAutoSelected && selectJobIdFromUrl()) { isJobFromUrlAutoSelected = true; } }
Source:
<code>public void testEncryptValidPassword( ) throws Exception { res = service.encrypt( "asdfghjkldieukancmvaiodfweewjrkwer" ); <START> assertEquals( res, "YXNkZmdoamtsZGlldWthbmNtdmFpb2Rmd2Vld2pya3dlcg==" ); <END> }</code><technical_language>worth decrypting verifying get original string</technical_language>

Target:
public void testEncryptValidPassword( ) throws Exception { String password = "asdfghjkldieukancmvaiodfweewjrkwer"; res = service.encrypt( password ); assertEquals( res, "YXNkZmdoamtsZGlldWthbmNtdmFpb2Rmd2Vld2pya3dlcg==" ); assertEquals( password, service.decrypt( res ) ); }
Source:
<code>public void testIdField() throws Exception { AccessibleObject idField = entityBinding.getIdField(); <START> assertEquals(idField.getName(), new ClassType(ParentClass.class).getDeclaredField("parentField").getName()); <END> }</code><technical_language>able test equality of new Types leveraging names</technical_language>

Target:
public void testIdField() throws Exception { AccessibleObject idField = entityBinding.getIdField(); assertEquals(idField, new ClassType(ParentClass.class).getDeclaredField("parentField")); }
Source:
<code>public boolean login() throws LoginException { boolean isLoggedIn; <START> String message = <END> "Username [%s] could not log in successfully using LDAP authentication due to an exception"; try { isLoggedIn = doLogin(); if (!isLoggedIn) { SecurityLogger.audit("Username [" + user + "] failed LDAP authentication."); } return isLoggedIn; } catch (InvalidCharactersException e) { SecurityLogger.audit(e.getMessage()); throw new LoginException(String.format(message, user)); } catch (LoginException e) { throw new LoginException(String.format(message, user)); } }</code><technical_language>this static final</technical_language>

Target:
public boolean login() throws LoginException { boolean isLoggedIn; try { isLoggedIn = doLogin(); if (!isLoggedIn) { SecurityLogger.audit("Username [" + user + "] failed LDAP authentication."); } return isLoggedIn; } catch (InvalidCharactersException e) { SecurityLogger.audit(e.getMessage()); throw new LoginException(String.format(LOGIN_ERROR_MESSAGE, user) + e.getMessage()); } catch (LoginException e) { throw new LoginException(String.format(LOGIN_ERROR_MESSAGE, user) + e.getMessage()); } }
Source:
<code>public static void main(String[] args) { Options options = handleOptions(Options.class, args); <START> String rcnamespace = options.itemNamespace() + "|" + options.propertyNamspace(); <END> WikibaseRepository wikibaseRepository = new WikibaseRepository(options.wikibaseScheme(), options.wikibaseHost(), 0, rcnamespace); URI sparqlUri; try { sparqlUri = new URI(options.sparqlUrl()); } catch (URISyntaxException e) { log.error("Invalid url: " + options.sparqlUrl() + " caused by " + e.getMessage()); return; } WikibaseUris uris = new WikibaseUris(options.wikibaseHost()); RdfRepository rdfRepository = new RdfRepository(sparqlUri, uris); Change.Source<? extends Change.Batch> changeSource = buildChangeSource(options, rdfRepository, wikibaseRepository); if (changeSource == null) { return; } int threads = options.threadCount(); ThreadFactoryBuilder threadFactory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s"); ExecutorService executor = new ThreadPoolExecutor(threads, threads, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory.build()); Munger munger = mungerFromOptions(options); new Update<>(changeSource, wikibaseRepository, rdfRepository, munger, executor, options.pollDelay(), uris, options.verify()).run(); }</code><technical_language>please a more descriptive name? I mean, I "rc" means, namespaces (plural, singular) relevant changes</technical_language>

Target:
public static void main(String[] args) { Options options = handleOptions(Options.class, args); WikibaseRepository wikibaseRepository; if (options.entityNamespaces() == null) { wikibaseRepository = new WikibaseRepository(options.wikibaseScheme(), options.wikibaseHost()); } else { String[] entityNamespaces = options.entityNamespaces().split(","); wikibaseRepository = new WikibaseRepository(options.wikibaseScheme(), options.wikibaseHost(), 0, entityNamespaces); } URI sparqlUri; try { sparqlUri = new URI(options.sparqlUrl()); } catch (URISyntaxException e) { log.error("Invalid url: " + options.sparqlUrl() + " caused by " + e.getMessage()); return; } WikibaseUris uris = new WikibaseUris(options.wikibaseHost()); RdfRepository rdfRepository = new RdfRepository(sparqlUri, uris); Change.Source<? extends Change.Batch> changeSource = buildChangeSource(options, rdfRepository, wikibaseRepository); if (changeSource == null) { return; } int threads = options.threadCount(); ThreadFactoryBuilder threadFactory = new ThreadFactoryBuilder().setDaemon(true).setNameFormat("update %s"); ExecutorService executor = new ThreadPoolExecutor(threads, threads, 0, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), threadFactory.build()); Munger munger = mungerFromOptions(options); new Update<>(changeSource, wikibaseRepository, rdfRepository, munger, executor, options.pollDelay(), uris, options.verify()).run(); }
Source:
<code>private static String getRelativeImportPathFromLine(String line, String workingDirectoryForFile) { String importPath = StringUtils.substringBetween(line, "'", "'"); importPath = importPath.replaceFirst(workingDirectoryForFile, ""); importPath = importPath.replaceFirst("^[.]/", ""); importPath = importPath.replaceFirst("^/", ""); <START> if (!importPath.endsWith(".nf")) { <END> importPath = importPath + ".nf"; } return importPath; }</code><technical_language>Suggest variable/const for ".nf"</technical_language>

Target:
protected static String getRelativeImportPathFromLine(String line, String workingDirectoryForFile) { final String nextflowFileExtension = ".nf"; String importPath = StringUtils.substringBetween(line, "'", "'"); importPath = importPath.replaceFirst(workingDirectoryForFile, ""); importPath = importPath.replaceFirst("^[.]/", ""); importPath = importPath.replaceFirst("^/", ""); if (!importPath.endsWith(nextflowFileExtension)) { importPath = importPath + nextflowFileExtension; } return importPath; }
Source:
<code>private void checkContextInRightPlace(DetailAST methodDefToken) { final DetailAST parametersToken = methodDefToken.findFirstToken(TokenTypes.PARAMETERS); final String returnType = getReturnType(methodDefToken.findFirstToken(TokenTypes.TYPE), new StringBuilder()).toString(); final boolean containsTypeParameter = TokenUtil.findFirstTokenByPredicate(parametersToken, parameterToken -> parameterToken.getType() == TokenTypes.PARAMETER_DEF <START> && parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT) != null <END> && parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT) .getText().equals(CONTEXT)) .isPresent(); if (containsTypeParameter) { if (returnType.startsWith(MONO_BRACKET) || returnType.startsWith(PAGED_FLUX_BRACKET)) { log(methodDefToken, String.format(ASYNC_CONTEXT_ERROR, CONTEXT)); } } else { if (returnType.startsWith(RESPONSE_BRACKET) || returnType.startsWith(PAGED_ITERABLE_BRACKET)) { log(methodDefToken, String.format(SYNC_CONTEXT_ERROR, CONTEXT)); } } }</code><technical_language>Instead of making traversal twice, assign a local variable. parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT)</technical_language>

Target:
private void checkContextInRightPlace(DetailAST methodDefToken) { final DetailAST parametersToken = methodDefToken.findFirstToken(TokenTypes.PARAMETERS); final String returnType = getReturnType(methodDefToken.findFirstToken(TokenTypes.TYPE), new StringBuilder()).toString(); final boolean containsContextParameter = TokenUtil.findFirstTokenByPredicate(parametersToken, parameterToken -> { if (parameterToken.getType() != TokenTypes.PARAMETER_DEF) { return false; } final DetailAST paramTypeIdentToken = parameterToken.findFirstToken(TokenTypes.TYPE).findFirstToken(TokenTypes.IDENT); return paramTypeIdentToken != null && CONTEXT.equals(paramTypeIdentToken.getText()); }) .isPresent(); if (containsContextParameter) { if (returnType.startsWith(MONO_BRACKET) || returnType.startsWith(PAGED_FLUX_BRACKET)) { log(methodDefToken, String.format(ASYNC_CONTEXT_ERROR, CONTEXT)); } } else { if (returnType.startsWith(RESPONSE_BRACKET)) { log(methodDefToken, String.format(SYNC_CONTEXT_ERROR, CONTEXT)); } } }
Source:
<code>public void display(OutputStream out) { final PrintWriter stdout; try { stdout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); } catch (UnsupportedEncodingException e) { throw new RuntimeException("JVM lacks UTF-8 encoding", e); } Map<String, PluginInfo> output = Maps.newTreeMap(); List<Plugin> plugins = Lists.newArrayList(pluginLoader.getPlugins(all)); Collections.sort(plugins, new Comparator<Plugin>() { @Override public int compare(Plugin a, Plugin b) { return a.getName().compareTo(b.getName()); } }); if (!format.isJson()) { stdout.format("%-30s %-10s %-8s\n", "Name", "Version", "Status"); stdout .print("-------------------------------------------------------------------------------\n"); } for (Plugin p : plugins) { PluginInfo info = new PluginInfo(); info.version = p.getVersion(); info.disabled = p.isDisabled(); if (format.isJson()) { output.put(p.getName(), info); } else { stdout.format("%-30s %-10s %-8s\n", p.getName(), <START> Strings.nullToEmpty(info.version), info.disabled ? "DISABLED" : ""); <END> } } if (format.isJson()) { format.newGson().toJson(output, new TypeToken<Map<String, PluginInfo>>() {}.getType(), stdout); stdout.print('\n'); } stdout.flush(); }</code><technical_language>nit: I put this a new line: Strings.nullToEmpty(info.version), info.disabled ? "DISABLED" : "");</technical_language>

Target:
public void display(OutputStream out) { final PrintWriter stdout; try { stdout = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, "UTF-8"))); } catch (UnsupportedEncodingException e) { throw new RuntimeException("JVM lacks UTF-8 encoding", e); } Map<String, PluginInfo> output = Maps.newTreeMap(); List<Plugin> plugins = Lists.newArrayList(pluginLoader.getPlugins(all)); Collections.sort(plugins, new Comparator<Plugin>() { @Override public int compare(Plugin a, Plugin b) { return a.getName().compareTo(b.getName()); } }); if (!format.isJson()) { stdout.format("%-30s %-10s %-8s\n", "Name", "Version", "Status"); stdout .print("-------------------------------------------------------------------------------\n"); } for (Plugin p : plugins) { PluginInfo info = new PluginInfo(); info.version = p.getVersion(); info.disabled = p.isDisabled() ? true : null; if (format.isJson()) { output.put(p.getName(), info); } else { stdout.format("%-30s %-10s %-8s\n", p.getName(), Strings.nullToEmpty(info.version), p.isDisabled() ? "DISABLED" : ""); } } if (format.isJson()) { format.newGson().toJson(output, new TypeToken<Map<String, PluginInfo>>() {}.getType(), stdout); stdout.print('\n'); } stdout.flush(); }
Source:
<code>public T call() throws Exception { long delay = min; int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (delay < max && retry <= maxRetries) { delay *= 2; <START> logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); <END> if(++logCounter == 1) logger.info("Exception --> "+ExceptionUtils.getFullStackTrace(e)); sleeper.sleep(delay); } else if(delay >= max && retry <= maxRetries) { logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); sleeper.sleep(max); } else { throw e; } } finally { forEachExecution(); } } }</code><technical_language>IIRC, I reason for printing out exception message full stack trace reduce noise in logs. I full stack printed if number of failures reaches some threshold. reconsider</technical_language>

Target:
public T call() throws Exception { long delay = min; int retry = 0; int logCounter = 0; while (true) { try { return retriableCall(); } catch (CancellationException e) { throw e; } catch (Exception e) { retry++; if (delay < max && retry <= maxRetries) { delay *= 2; logger.error(String.format("Retry #%d for: %s",retry, e.getMessage())); if(++logCounter == 1) logger.info("Exception --> "+ExceptionUtils.getFullStackTrace(e)); sleeper.sleep(delay); } else if(delay >= max && retry <= maxRetries) { logger.error(String.format("Retry #%d for: %s",retry, ExceptionUtils.getFullStackTrace(e))); sleeper.sleep(max); } else { throw e; } } finally { forEachExecution(); } } }
Source:
<code>public Object[][] createNonTiling() { if (percentageOfTilingTests == 0) { <START> return new Object[][] {{0, false, false, 0, 0, null, 0}}; <END> } int[] tileSizes = {PLANE_WIDTH}; int[] channelCounts = {1, 3}; int[] seriesCounts = {1}; int[] timeCounts = {1, 5}; String[] compressions = {COMPRESSION_UNCOMPRESSED, COMPRESSION_LZW, COMPRESSION_J2K, COMPRESSION_J2K_LOSSY, COMPRESSION_JPEG}; return getData(tileSizes, channelCounts, seriesCounts, timeCounts, compressions); }</code><technical_language>default updated return 8 parameters test</technical_language>

Target:
public Object[][] createNonTiling() { if (percentageOfTilingTests == 0) { return new Object[][] {{0, false, false, 0, 0, 0, null, 0}}; } int[] tileSizes = {PLANE_WIDTH}; int[] channelCounts = {1, 3}; int[] seriesCounts = {1}; int[] timeCounts = {1, 5}; String[] compressions = {COMPRESSION_UNCOMPRESSED, COMPRESSION_LZW, COMPRESSION_J2K, COMPRESSION_J2K_LOSSY, COMPRESSION_JPEG}; return getData(tileSizes, channelCounts, seriesCounts, timeCounts, compressions); }
Source:
<code><START> public Map<String, SystemAdmin> getSystemAdmins() { <END> if (systemAdminMap.isEmpty()) { systemAdminMap = getSystemFactories().entrySet() .stream() .collect(Collectors.toMap(Entry::getKey, systemNameToFactoryEntry -> systemNameToFactoryEntry.getValue() .getAdmin(systemNameToFactoryEntry.getKey(), this, adminLabel))); } return systemAdminMap; }</code><technical_language>I if is pass admin label in getSystemAdmins()</technical_language>

Target:
public Map<String, SystemAdmin> getSystemAdmins() { return getSystemAdmins(""); }
Source:
<code>public void testReadingValidLongDate() { String jsonString = "{\"currentDate\": 1546344000000}"; GsonTypeAdaptersTestPojo parsedDate = gson.fromJson(jsonString, GsonTypeAdaptersTestPojo.class); <START> assertThat(parsedDate.currentDate.toString(), equalTo("Tue Jan 01 07:00:00 EST 2019")); <END> }</code><technical_language>Is this dependent computer's time zone</technical_language>

Target:
public void testReadingValidLongDate() { String jsonString = "{\"currentDate\": 1546326000000}"; GsonTypeAdaptersTestPojo parsedDate = gson.fromJson(jsonString, GsonTypeAdaptersTestPojo.class); Instant parsedInstant = parsedDate.currentDate.toInstant().atOffset(ZoneOffset.UTC).toInstant(); assertThat(parsedInstant.toEpochMilli(), equalTo(1546326000000L)); }
Source:
<code>public static void assertContainerRam(Set<PackingPlan.ContainerPlan> containerPlans, long maxRamforResources) { for (PackingPlan.ContainerPlan containerPlan : containerPlans) { <START> Assert.assertTrue("Container with id: " + containerPlan.getId() + " requires more RAM " + "(" <END> + containerPlan.getRequiredResource().getRam() + ")" + " than the maximimum allowed" + "(" + maxRamforResources + ")", containerPlan.getRequiredResource().getRam() <= maxRamforResources); } }</code><technical_language>IMO improves readability is generally typo-prone text template, dynamic args follow. easier update text " + foo + "s work with. this is subjective I suppose</technical_language>

Target:
public static void assertContainerRam(Set<PackingPlan.ContainerPlan> containerPlans, long maxRamforResources) { for (PackingPlan.ContainerPlan containerPlan : containerPlans) { Assert.assertTrue(String.format("Container with id: %d requires more RAM (%d) than" + " the maximum RAM allowed (%d)", containerPlan.getId(), containerPlan.getRequiredResource().getRam(), maxRamforResources), containerPlan.getRequiredResource().getRam() <= maxRamforResources); } }
Source:
<code>public void copyPersistedState(String destinationDir, @Nullable String destinationLocation, @Nullable CompoundTransformer transformer) { initManagementContext(); try { highAvailabilityMode = HighAvailabilityMode.HOT_STANDBY; initPersistence(); } catch (Exception e) { handleSubsystemStartupError(ignorePersistenceErrors, "persistence", e); } ManagementPlaneSyncRecord planeState = managementContext.getHighAvailabilityManager().getManagementPlaneSyncState(); BrooklynMementoRawData memento = retrieveState(false); BrooklynMementoRawData newMemento = memento; if (transformer != null) { try { newMemento = transformer.transform(memento); } catch (Exception e) { <START> throw Throwables.propagate(e); <END> } } copyPersistedState(newMemento, planeState, destinationDir, destinationLocation); }</code><technical_language>throw Exceptions.propagate(e) handles InterruptedException correctly</technical_language>

Target:
public void copyPersistedState(String destinationDir, @Nullable String destinationLocation, @Nullable CompoundTransformer transformer) { initManagementContext(); try { highAvailabilityMode = HighAvailabilityMode.HOT_STANDBY; initPersistence(); } catch (Exception e) { handleSubsystemStartupError(ignorePersistenceErrors, "persistence", e); } ManagementPlaneSyncRecord planeState = managementContext.getHighAvailabilityManager().getManagementPlaneSyncState(); BrooklynMementoRawData memento = retrieveState(false); BrooklynMementoRawData newMemento = memento; if (transformer != null) { try { newMemento = transformer.transform(memento); } catch (Exception e) { throw Exceptions.propagate(e); } } copyPersistedState(newMemento, planeState, destinationDir, destinationLocation); }
Source:
<code>public void showNoRepositorySelectedPleaseSelectARepository() { <START> } <END></code><technical_language>this do ErrorPopup.showMessage( ProjectEditorResources.CONSTANTS.NoRepositorySelectedPleaseSelectARepository() )</technical_language>

Target:
public void showNoRepositorySelectedPleaseSelectARepository() { ErrorPopup.showMessage( ProjectEditorResources.CONSTANTS.NoRepositorySelectedPleaseSelectARepository() ); }