auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Dialog onCreateDialog(Bundle savedInstanceState) { ((HasComponent<ActivityComponent>) getActivity()).getComponent().inject(this); LayoutInflater inflater = parentActivity.getLayoutInflater(); View view = inflater.inflate(R.layout.tos_view, null); String apologyText = parentActivity.getString(R.string.language_apology_text); Spanned formattedApologyText = Html.fromHtml(apologyText); TextView apologyTextView = (TextView) view.findViewById(R.id.language_apology_box_text); apologyTextView.setText(formattedApologyText, TextView.BufferType.SPANNABLE); String eulaText = String.format(parentActivity.getString(R.string.eula_text) + getVersionName()); Spanned formattedEulaText = Html.fromHtml(eulaText); TextView eulaTextView = (TextView) view.findViewById(R.id.eula_box_text); eulaTextView.setText(formattedEulaText, TextView.BufferType.SPANNABLE); AlertDialog.Builder tosDialogBuilder = new AlertDialog.Builder(parentActivity) .setTitle(R.string.menu_tos) .setView(view); if (resultListener != null) { tosDialogBuilder .setPositiveButton(R.string.dialog_accept, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { acceptEula(dialog); } }) .setNegativeButton(R.string.dialog_decline, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { rejectEula(dialog); } }); } return tosDialogBuilder.create(); }

Target:
public Dialog onCreateDialog(Bundle savedInstanceState) { ((HasComponent<ActivityComponent>) getActivity()).getComponent().inject(this); LayoutInflater inflater = parentActivity.getLayoutInflater(); View view = inflater.inflate(R.layout.tos_view, null); String apologyText = parentActivity.getString(R.string.language_apology_text); Spanned formattedApologyText = Html.fromHtml(apologyText); TextView apologyTextView = (TextView) view.findViewById(R.id.language_apology_box_text); apologyTextView.setText(formattedApologyText, TextView.BufferType.SPANNABLE); String eulaText = parentActivity.getString(R.string.eula_text); Spanned formattedEulaText = Html.fromHtml(eulaText); TextView eulaTextView = (TextView) view.findViewById(R.id.eula_box_text); eulaTextView.setText(formattedEulaText, TextView.BufferType.SPANNABLE); AlertDialog.Builder tosDialogBuilder = new AlertDialog.Builder(parentActivity) .setTitle(R.string.menu_tos) .setView(view); if (resultListener != null) { tosDialogBuilder .setPositiveButton(R.string.dialog_accept, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { acceptEula(dialog); } }) .setNegativeButton(R.string.dialog_decline, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int whichButton) { rejectEula(dialog); } }); } return tosDialogBuilder.create(); }
Source:
private static boolean isLessThan2048(PyExpressionTree expression) { return expression.is(Kind.NUMERIC_LITERAL) && ((PyNumericLiteralTree) expression).valueAsLong() < 2048; }

Target:
private static boolean isLessThan2048(PyExpressionTree expression) { try { return expression.is(Kind.NUMERIC_LITERAL) && ((PyNumericLiteralTree) expression).valueAsLong() < 2048; } catch (NumberFormatException nfe) { return false; } }
Source:
public void testLoginChoosingAuthenticationServiceFails() throws Exception { securedLoginServiceImpl = new SecuredLoginServiceImpl(authenticationService, sessionService, sessionAccessor, identityService, logger); final Map<String, Serializable> credentials = new HashMap<String, Serializable>(); final String login = "julien"; final String password = "julien"; credentials.put(AuthenticationConstants.BASIC_USERNAME, login); credentials.put(AuthenticationConstants.BASIC_PASSWORD, password); when(authenticationService.checkUserCredentials(login, password)).thenReturn(false); final String result = securedLoginServiceImpl.loginChoosingAppropriateAuthenticationService(credentials); verify(authenticationService, times(1)).checkUserCredentials(login, password); assertThat(result).isNull(); }

Target:
public void testLoginChoosingAuthenticationServiceFails() throws Exception { securedLoginServiceImpl = instantiateLoginServiceWithAuthenticationService(); final Map<String, Serializable> credentials = new HashMap<String, Serializable>(); final String login = "julien"; final String password = "julien"; credentials.put(AuthenticationConstants.BASIC_USERNAME, login); credentials.put(AuthenticationConstants.BASIC_PASSWORD, password); when(authenticationService.checkUserCredentials(login, password)).thenReturn(false); final String result = securedLoginServiceImpl.loginChoosingAppropriateAuthenticationService(credentials); verify(authenticationService, times(1)).checkUserCredentials(login, password); assertThat(result).isNull(); }
Source:
public void updateActivity(final boolean broadcast) { if (isAfk()) { setAfk(false); if (broadcast && !isHidden()) { setDisplayNick(); final String msg = tl("userIsNotAway", getDisplayName()); final String selfmsg = tl("userIsNotAwaySelf"); if (!msg.isEmpty()) { if (ess.getSettings().broadcastAfkMessage()) { ess.broadcastMessage(this, msg, Collections.singleton(this)); this.sendMessage(selfmsg); } else { this.sendMessage(selfmsg); } } } } lastActivity = System.currentTimeMillis(); }

Target:
public void updateActivity(final boolean broadcast) { updateActivity(broadcast, AfkStatusChangeEvent.Cause.UNKNOWN); }
Source:
protected void runTask() { ContentListingProgress progress = getProgress(); onStart(progress); List<String> contentUris = contentLister.listContentUris(listingCriteria(progress)); log.info("Running equiv on all content from {}", progress.getPublisher()); if (executor == null) { runSynchronously(contentUris); } else { runAsynchronously(contentUris); } }

Target:
protected void runTask() { ContentListingProgress progress = getProgress(); onStart(progress); Iterator<String> uriIterator = contentLister.listContentUris(listingCriteria(progress)); Queue<String> contentUris = new LinkedList<>(); uriIterator.forEachRemaining(contentUris::add); log.info("Running equiv on all content from {}", progress.getPublisher()); if (executor == null) { runSynchronously(contentUris); } else { runAsynchronously(contentUris); } }
Source:
public void start() { log.info("Starting spider..."); this.timeStarted = new Date(); fetchFilterSeeds(); if (seedList == null || seedList.isEmpty()) { log.warn("No seeds available for the Spider. Cancelling scan..."); notifyListenersSpiderComplete(false); notifyListenersSpiderProgress(100, 0, 0); return; } if (scanUser != null) log.info("Scan will be performed from the point of view of User: " + scanUser.getName()); this.controller.init(); this.stopped = false; this.paused = false; this.initialized = false; this.threadPool = Executors.newFixedThreadPool(spiderParam.getThreadCount()); httpSender = new HttpSender(connectionParam, true, HttpSender.SPIDER_INITIATOR); httpSender.setFollowRedirect(false); for (URI uri : seedList) { if (log.isDebugEnabled()) { log.debug("Adding seed for spider: " + uri); } controller.addSeed(uri, HttpRequestHeader.GET); } initialized = true; }

Target:
public void start() { log.info("Starting spider..."); this.timeStarted = System.currentTimeMillis(); fetchFilterSeeds(); if (seedList == null || seedList.isEmpty()) { log.warn("No seeds available for the Spider. Cancelling scan..."); notifyListenersSpiderComplete(false); notifyListenersSpiderProgress(100, 0, 0); return; } if (scanUser != null) log.info("Scan will be performed from the point of view of User: " + scanUser.getName()); this.controller.init(); this.stopped = false; this.paused = false; this.initialized = false; this.threadPool = Executors.newFixedThreadPool(spiderParam.getThreadCount()); httpSender = new HttpSender(connectionParam, true, HttpSender.SPIDER_INITIATOR); httpSender.setFollowRedirect(false); for (URI uri : seedList) { if (log.isDebugEnabled()) { log.debug("Adding seed for spider: " + uri); } controller.addSeed(uri, HttpRequestHeader.GET); } initialized = true; }
Source:
public void setJpegQuality(RCTCameraView view, int jpegQuality) { view.setTorchMode(jpegQuality); }

Target:
public void setJpegQuality(RCTCameraView view, int jpegQuality) { view.setJpegQuality(jpegQuality); }
Source:
private void attemptToAssignToForce(Unit unit, int sourceForceID, Campaign sourceCampaign, Campaign destinationCampaign) { Force sourceForce = sourceCampaign.getForce(sourceForceID); if(sourceForce == null) { return; } if(sourceForce.getParentForce() == null) { destinationCampaign.getForces().addUnit(unit.getId()); } Force destForce = findForce(sourceForce.getFullName(), destinationCampaign.getForces()); if(destForce != null) { destForce.addUnit(unit.getId()); } else { List<Force> parentForces = getForceAndParents(sourceForce); Force currentDestinationForce = destinationCampaign.getForces(); for(int x = parentForces.size() - 1; x >= 0; x--) { Force nextSourceForce = parentForces.get(x); Force nextDestinationForce = findForce(nextSourceForce.getFullName(), currentDestinationForce); if(nextDestinationForce == null) { Force forceCopy = new Force(nextSourceForce.getName()); destinationCampaign.addForce(forceCopy, currentDestinationForce); currentDestinationForce = forceCopy; } else { currentDestinationForce = nextDestinationForce; } } currentDestinationForce.addUnit(unit.getId()); } }

Target:
private void attemptToAssignToForce(Unit unit, int sourceForceID, Campaign sourceCampaign, Campaign destinationCampaign) { Force sourceForce = sourceCampaign.getForce(sourceForceID); if (sourceForce == null) { return; } if (sourceForce.getParentForce() == null) { destinationCampaign.getForces().addUnit(unit.getId()); } String sourceForceFullName = getDestinationFullName(sourceForce, sourceCampaign, destinationCampaign); Force destForce = findForce(sourceForceFullName, destinationCampaign.getForces()); if (destForce != null) { destForce.addUnit(unit.getId()); } else { List<Force> parentForces = getForceAndParents(sourceForce); Force currentDestinationForce = destinationCampaign.getForces(); for (int x = parentForces.size() - 1; x >= 0; x--) { Force nextSourceForce = parentForces.get(x); String nextSourceForceFullName = getDestinationFullName(nextSourceForce, sourceCampaign, destinationCampaign); Force nextDestinationForce = findForce(nextSourceForceFullName, currentDestinationForce); if (nextDestinationForce == null) { Force forceCopy = new Force(nextSourceForce.getName()); destinationCampaign.addForce(forceCopy, currentDestinationForce); currentDestinationForce = forceCopy; } else { currentDestinationForce = nextDestinationForce; } } currentDestinationForce.addUnit(unit.getId()); } }
Source:
private String toConnectionInfoString() { return "{ metastore-uri: " + metastoreUri + ", " + "database: " + database + ", " + "table: " + table + ", " + "partitioned-table: " + isPartitionedTable() + ", " + "dynamic-partitioning: " + isDynamicPartitioning() + ", " + "username: " + username + ", " + "secure-mode: " + secureMode + ", " + "record-writer: " + recordWriter.getClass().getSimpleName() + ", " + "agent-info: " + agentInfo + ", " + "writeId: " + writeId + " }"; }

Target:
private String toConnectionInfoString() { return "{ metastore-uri: " + metastoreUri + ", " + "database: " + database + ", " + "table: " + table + ", " + "partitioned-table: " + isPartitionedTable() + ", " + "dynamic-partitioning: " + isDynamicPartitioning() + ", " + "username: " + username + ", " + "secure-mode: " + secureMode + ", " + "record-writer: " + recordWriter.getClass().getSimpleName() + ", " + "agent-info: " + agentInfo + ", " + "writeId: " + writeId + ", " + "statementId: " + statementId + " }"; }
Source:
public void processQueue() { if (Thread.currentThread() == thread) { throw new IllegalStateException( "Cannot execute this method in the realm's own thread"); } try { synchronized (queue) { doProcess = true; queue.notifyAll(); while (!queue.isEmpty()) { if (!block) throw new IllegalStateException( "Cannot process queue, ThreadRealm is not blocking on its thread"); queue.wait(); } doProcess = false; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }

Target:
public void processQueue() { if (Thread.currentThread() == thread) { throw new IllegalStateException( "Cannot execute this method in the realm's own thread"); } try { synchronized (queue) { while (!queue.isEmpty()) { if (!block) throw new IllegalStateException( "Cannot process queue, ThreadRealm is not blocking on its thread"); queue.wait(); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
Source:
public void testFileBatchInputFormatAvroNullSchema() throws Exception { File fileAvro = new File(temporaryFolder.newFolder(), "test.avro"); String outputDatasetName = "test-filesource-avro-null-schema"; String appName = "FileSourceAvroNullSchema"; ApplicationManager appManager = createSourceAndDeployApp(appName, fileAvro, "avro", outputDatasetName, null); Schema recordSchemaWithoutPathField = Schema.recordOf("record", Schema.Field.of("i", Schema.of(Schema.Type.INT)), Schema.Field.of("l", Schema.of(Schema.Type.LONG))); org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(recordSchemaWithoutPathField. toString()); GenericRecord record = new GenericRecordBuilder(avroSchema) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .build(); DataSetManager<TimePartitionedFileSet> inputManager = getDataset("TestFile"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<>(avroSchema); DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<>(datumWriter); dataFileWriter.create(avroSchema, fileAvro); dataFileWriter.append(record); dataFileWriter.close(); inputManager.flush(); workflowStartAndWait(appManager); List<StructuredRecord> expected = ImmutableList.of( StructuredRecord.builder(RECORD_SCHEMA) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .set("file", fileAvro.toURI().toString()) .build() ); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(output, expected); }

Target:
public void testFileBatchInputFormatAvroNullSchema() throws Exception { File fileAvro = new File(temporaryFolder.newFolder(), "test.avro"); String outputDatasetName = "test-filesource-avro-null-schema"; String appName = "FileSourceAvroNullSchema"; ApplicationManager appManager = createSourceAndDeployApp(appName, fileAvro, "avro", outputDatasetName, null); Schema recordSchemaWithoutPathField = Schema.recordOf("record", Schema.Field.of("i", Schema.of(Schema.Type.INT)), Schema.Field.of("l", Schema.of(Schema.Type.LONG))); org.apache.avro.Schema avroSchema = new org.apache.avro.Schema.Parser().parse(recordSchemaWithoutPathField. toString()); GenericRecord record = new GenericRecordBuilder(avroSchema) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .build(); DataSetManager<TimePartitionedFileSet> inputManager = getDataset("TestFile"); DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<>(avroSchema); DataFileWriter<GenericRecord> dataFileWriter = new DataFileWriter<>(datumWriter); dataFileWriter.create(avroSchema, fileAvro); dataFileWriter.append(record); dataFileWriter.close(); inputManager.flush(); workflowStartAndWait(appManager); List<StructuredRecord> expected = ImmutableList.of( StructuredRecord.builder(RECORD_SCHEMA) .set("i", Integer.MAX_VALUE) .set("l", Long.MAX_VALUE) .set("file", fileAvro.toURI().toString()) .build() ); DataSetManager<Table> outputManager = getDataset(outputDatasetName); List<StructuredRecord> output = MockSink.readOutput(outputManager); Assert.assertEquals(expected, output); }
Source:
public static void classLevelSetup() throws Exception { Map<String, String> overrides = new HashMap<>(); overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), GzipJSONMessageEncoder.class.getCanonicalName()); overrides.put(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "true"); overrides.put(HiveConf.ConfVars.HIVE_TXN_MANAGER.varname, "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager"); overrides.put(MetastoreConf.ConfVars.CAPABILITY_CHECK.getHiveName(),"false"); overrides.put(HiveConf.ConfVars.REPL_BOOTSTRAP_DUMP_OPEN_TXN_TIMEOUT.varname,"1s"); overrides.put(HiveConf.ConfVars.DYNAMICPARTITIONINGMODE.varname, "nonstrict"); overrides.put("mapred.input.dir.recursive", "true"); internalBeforeClassSetup(overrides, overrides, TestReplicationScenarios.class, false, "mm"); }

Target:
public static void classLevelSetup() throws Exception { Map<String, String> overrides = new HashMap<>(); overrides.put(MetastoreConf.ConfVars.EVENT_MESSAGE_FACTORY.getHiveName(), GzipJSONMessageEncoder.class.getCanonicalName()); overrides.put(HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname, "true"); overrides.put(HiveConf.ConfVars.HIVE_TXN_MANAGER.varname, "org.apache.hadoop.hive.ql.lockmgr.DbTxnManager"); overrides.put(MetastoreConf.ConfVars.CAPABILITY_CHECK.getHiveName(), "false"); overrides.put(HiveConf.ConfVars.REPL_BOOTSTRAP_DUMP_OPEN_TXN_TIMEOUT.varname, "1s"); overrides.put(HiveConf.ConfVars.DYNAMICPARTITIONINGMODE.varname, "nonstrict"); overrides.put("mapred.input.dir.recursive", "true"); internalBeforeClassSetup(overrides, overrides, TestStatsReplicationScenariosMMNoAutogather.class, false, AcidTableKind.INSERT_ONLY); }
Source:
public CaseInsensitiveHashMap<K, V> toImmutableCaseInsensitiveMap() { if (this instanceof ImmutableCaseInsensitiveHashMap) { return this; } if (this.isEmpty() && EMPTY_MAP != null) { return EMPTY_MAP; } return new ImmutableCaseInsensitiveHashMap<>(this); }

Target:
public CaseInsensitiveHashMap<K, V> toImmutableCaseInsensitiveMap() { if (this.isEmpty() && EMPTY_MAP != null) { return EMPTY_MAP; } return new ImmutableCaseInsensitiveHashMap<>(this); }
Source:
private State parseHUE(final String value) { if(!value.startsWith("HUE") || value.length() != 6) return null; try { final double hue = Integer.valueOf(value.substring(3, 6)); return new PercentType(new BigDecimal(hue / 255d * 100d)); } catch (NumberFormatException e) { logger.warn("cannot parse color from " + value, e); } return null; }

Target:
private State parseHUE(final String value) { if (!value.startsWith("HUE") || value.length() != 6) return null; try { final double hue = Integer.valueOf(value.substring(3, 6)); return new PercentType(new BigDecimal(hue / 255d * 100d)); } catch (NumberFormatException e) { logger.warn("cannot parse color from {}", value, e); } return null; }
Source:
private static List<List<JavaFileScannerContext.Location>> initFlows(int arity) { List<List<JavaFileScannerContext.Location>> result = new ArrayList<>(arity + 1); for (int i = 0; i < arity + 1; i++) { result.add(0, ImmutableList.of()); } return result; }

Target:
private static List<List<JavaFileScannerContext.Location>> initFlows(int arity) { return IntStream .range(0, arity + 1) .mapToObj(i -> ImmutableList.<JavaFileScannerContext.Location>of()) .collect(Collectors.toList()); }
Source:
protected void doStart() throws Exception { log.info("Context: {}", camelContext); String groupId = UUID.randomUUID().toString(); log.debug("Creating consumer with {}[{}]", ConsumerConfig.GROUP_ID_CONFIG, groupId); consumerConfig.put(ConsumerConfig.GROUP_ID_CONFIG, groupId); consumerConfig.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, Boolean.TRUE.toString()); consumerConfig.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumerConfig.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumer = new KafkaConsumer<>(consumerConfig); producerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerConfig.putIfAbsent(ProducerConfig.ACKS_CONFIG, "1"); producerConfig.putIfAbsent(ProducerConfig.BATCH_SIZE_CONFIG, "0"); producer = new KafkaProducer<>(producerConfig); cacheReadyLatch = new CountDownLatch(1); topicPoller = new TopicPoller(consumer, cacheReadyLatch); }

Target:
protected void doStart() throws Exception { StringHelper.notEmpty(topic, "topic"); this.cache = Collections.synchronizedMap(new LRUCache<>(maxCacheSize)); if (consumerConfig == null) { consumerConfig = new Properties(); StringHelper.notEmpty(bootstrapServers, "bootstrapServers"); consumerConfig.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); } if (producerConfig == null) { producerConfig = new Properties(); StringHelper.notEmpty(bootstrapServers, "bootstrapServers"); producerConfig.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers); } ObjectHelper.notNull(consumerConfig, "consumerConfig"); ObjectHelper.notNull(producerConfig, "producerConfig"); String groupId = UUID.randomUUID().toString(); log.debug("Creating consumer with {}[{}]", ConsumerConfig.GROUP_ID_CONFIG, groupId); consumerConfig.put(ConsumerConfig.GROUP_ID_CONFIG, groupId); consumerConfig.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, Boolean.TRUE.toString()); consumerConfig.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumerConfig.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class.getName()); consumer = new KafkaConsumer<>(consumerConfig); producerConfig.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerConfig.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class.getName()); producerConfig.putIfAbsent(ProducerConfig.ACKS_CONFIG, "1"); producerConfig.putIfAbsent(ProducerConfig.BATCH_SIZE_CONFIG, "0"); producer = new KafkaProducer<>(producerConfig); cacheReadyLatch = new CountDownLatch(1); topicPoller = new TopicPoller(consumer, cacheReadyLatch, pollDurationMs); }
Source:
public boolean loginCookieAvailable() { return !config.get("env").contains("dev"); }

Target:
public boolean loginCookieAvailable() { return !((config.get("env").contains("dev")) || (config.get("env").contains("sandbox"))); }
Source:
public void setMessage(final Message aMessage, final boolean isRequest) { try { EventQueue.invokeAndWait( new Runnable() { @Override public void run() { msg = aMessage; CardLayout cl = (CardLayout) (panelContent.getLayout()); request = isRequest; if (isRequest) { requestPanel.setMessage(aMessage, true); requestPanel.setEditable(true); cl.show(panelContent, REQUEST_PANEL); } else { responsePanel.setMessage(aMessage, true); responsePanel.setEditable(true); cl.show(panelContent, RESPONSE_PANEL); } getButtonFixContentLength().setEnabled(msg instanceof HttpMessage); } }); } catch (Exception e) { LOGGER.warn(e.getMessage(), e); } }

Target:
public void setMessage(final Message aMessage, final boolean isRequest) { try { EventQueue.invokeAndWait( new Runnable() { @Override public void run() { msg = aMessage; CardLayout cl = (CardLayout) (panelContent.getLayout()); request = isRequest; if (isRequest) { requestPanel.setMessage(aMessage, true); requestPanel.setEditable(true); getRequestButtonFixContentLength() .setVisible(msg instanceof HttpMessage); cl.show(panelContent, REQUEST_PANEL); } else { responsePanel.setMessage(aMessage, true); responsePanel.setEditable(true); getResponseButtonFixContentLength() .setVisible(msg instanceof HttpMessage); cl.show(panelContent, RESPONSE_PANEL); } } }); } catch (Exception e) { LOGGER.warn(e.getMessage(), e); } }
Source:
synchronized boolean isRejected() { return rejected; }

Target:
synchronized boolean isRejected() { synchronized (conn) { return rejected; } }
Source:
public D save(D definition) { Assert.notNull(definition, "Definition may not be null"); String name = definition.getName(); String def = definition.getDefinition(); validateBeforeSave(name, def); if (repository.findOne(definition.getName()) != null) { throwDefinitionAlreadyExistsException(definition); } List<ModuleDescriptor> moduleDescriptors = parser.parse(name, def, definitionKind); List<ModuleDefinition> moduleDefinitions = createModuleDefinitions(moduleDescriptors); if (!moduleDefinitions.isEmpty()) { definition.setModuleDefinitions(moduleDefinitions); } D savedDefinition = repository.save(definition); return afterSave(savedDefinition); }

Target:
public D save(D definition) { Assert.notNull(definition, "Definition may not be null"); String name = definition.getName(); String def = definition.getDefinition(); validateBeforeSave(name, def); List<ModuleDescriptor> moduleDescriptors = parser.parse(name, def, definitionKind); List<ModuleDefinition> moduleDefinitions = createModuleDefinitions(moduleDescriptors); if (!moduleDefinitions.isEmpty()) { definition.setModuleDefinitions(moduleDefinitions); } D savedDefinition = repository.save(definition); return afterSave(savedDefinition); }
Source:
public static IModelGeometry<?> getModel(ResourceLocation loaderId, JsonDeserializationContext deserializationContext, JsonObject data) { try { if (!loaders.containsKey(loaderId)) throw new IllegalStateException(String.format("Model loader '%s' not found.", loaderId)); IModelLoader<?> loader = loaders.get(loaderId); return loader.read(deserializationContext, data); } catch(Exception e) { e.printStackTrace(); throw e; } }

Target:
public static IModelGeometry<?> getModel(ResourceLocation loaderId, JsonDeserializationContext deserializationContext, JsonObject data) { try { if (!loaders.containsKey(loaderId)) { throw new IllegalStateException(String.format("Model loader '%s' not found. Registered loaders: %s", loaderId, loaders.keySet().stream().map(ResourceLocation::toString).collect(Collectors.joining(", ")))); } IModelLoader<?> loader = loaders.get(loaderId); return loader.read(deserializationContext, data); } catch(Exception e) { e.printStackTrace(); throw e; } }
Source:
public void findInPage(String s) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { parentActivity.getCurPageFragment().getWebView().setFindListener(new FindListener() { @Override public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches, boolean isDoneCounting) { if (!isDoneCounting) { return; } if (numberOfMatches > 0) { findInPageMatch.setText( Integer.toString(activeMatchOrdinal + 1) + "/" + Integer.toString(numberOfMatches) ); findInPageMatch.setTextColor(Color.BLACK); findInPageNext.setEnabled(true); findInPagePrev.setEnabled(true); } else { findInPageMatch.setText("0/0"); findInPageMatch.setTextColor(Color.RED); findInPageNext.setEnabled(false); findInPagePrev.setEnabled(false); } findInPageMatch.setVisibility(View.VISIBLE); } }); parentActivity.getCurPageFragment().getWebView().findAllAsync(s); } else { parentActivity.getCurPageFragment().getWebView().findAll(s); } }

Target:
public void findInPage(String s) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { parentActivity.getCurPageFragment().getWebView().setFindListener(new FindListener() { @Override public void onFindResultReceived(int activeMatchOrdinal, int numberOfMatches, boolean isDoneCounting) { if (!isDoneCounting) { return; } if (numberOfMatches > 0) { findInPageMatch.setText( Integer.toString(activeMatchOrdinal + 1) + "/" + Integer.toString(numberOfMatches) ); findInPageNext.setEnabled(true); findInPagePrev.setEnabled(true); } else { findInPageMatch.setText("0/0"); findInPageNext.setEnabled(false); findInPagePrev.setEnabled(false); } findInPageMatch.setVisibility(View.VISIBLE); } }); parentActivity.getCurPageFragment().getWebView().findAllAsync(s); } else { parentActivity.getCurPageFragment().getWebView().findAll(s); } }
Source:
public static boolean isAuthenticated(HttpServletRequest request) { return request.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) != null; }

Target:
public static boolean isAuthenticated(HttpServletRequest request) { return (request.getSession(false) != null && request.getSession(false) .getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) != null) || request.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY) != null; }
Source:
public Map<String, ValidationResult> preEntitlement(Consumer consumer, Consumer host, Collection<PoolQuantity> entitlementPoolQuantities, CallerType caller) { JsonJsContext args = new JsonJsContext(objectMapper); args.put("consumer", consumer); args.put("hostConsumer", host); args.put("consumerEntitlements", consumer.getEntitlements()); args.put("standalone", config.getBoolean(ConfigProperties.STANDALONE)); args.put("poolQuantities", entitlementPoolQuantities); args.put("caller", caller.getLabel()); args.put("log", log, false); String json = jsRules.runJsFunction(String.class, "validate_pools_batch", args); Map<String, ValidationResult> resultMap; TypeReference<Map<String, ValidationResult>> typeref = new TypeReference<Map<String, ValidationResult>>() {}; try { resultMap = objectMapper.toObject(json, typeref); for (PoolQuantity poolQuantity : entitlementPoolQuantities) { if (!resultMap.containsKey(poolQuantity.getPool().getId())) { resultMap.put(poolQuantity.getPool().getId(), new ValidationResult()); log.info("no result returned for pool:" + poolQuantity.getPool()); } finishValidation(resultMap.get(poolQuantity.getPool().getId()), poolQuantity.getPool(), poolQuantity.getQuantity()); } } catch (Exception e) { throw new RuleExecutionException(e); } return resultMap; }

Target:
public Map<String, ValidationResult> preEntitlement(Consumer consumer, Consumer host, Collection<PoolQuantity> entitlementPoolQuantities, CallerType caller) { JsonJsContext args = new JsonJsContext(objectMapper); args.put("consumer", consumer); args.put("hostConsumer", host); args.put("consumerEntitlements", consumer.getEntitlements()); args.put("standalone", config.getBoolean(ConfigProperties.STANDALONE)); args.put("poolQuantities", entitlementPoolQuantities); args.put("caller", caller.getLabel()); args.put("log", log, false); String json = jsRules.runJsFunction(String.class, "validate_pools_batch", args); Map<String, ValidationResult> resultMap; TypeReference<Map<String, ValidationResult>> typeref = new TypeReference<Map<String, ValidationResult>>() {}; try { resultMap = objectMapper.toObject(json, typeref); for (PoolQuantity poolQuantity : entitlementPoolQuantities) { if (!resultMap.containsKey(poolQuantity.getPool().getId())) { resultMap.put(poolQuantity.getPool().getId(), new ValidationResult()); log.info("no result returned for pool: {}", poolQuantity.getPool()); } finishValidation(resultMap.get(poolQuantity.getPool().getId()), poolQuantity.getPool(), poolQuantity.getQuantity()); } } catch (Exception e) { throw new RuleExecutionException(e); } return resultMap; }
Source:
private void initComponents() { setLayout(new MigLayout("", "[100:pref,fill]", "[100:pref,fill]")); mJailPanel.addComponentListener(new ComponentListener() { @Override public void componentResized(ComponentEvent e) { mJailPanel.updateDimensions(e.getComponent().getParent().getWidth(), e.getComponent().getParent().getHeight()); } @Override public void componentMoved(ComponentEvent e) { } @Override public void componentShown(ComponentEvent e) { } @Override public void componentHidden(ComponentEvent e) { } }); JPanel statusPanel = new JPanel(); statusPanel.setOpaque(false); statusPanel.setLayout(new MigLayout("", "[50:pref]", "[pref!]")); statusPanel.add(new JLabel(Messages.getString("GamePanel.player")), "cell 0 0"); statusPanel.add(mPlayerName, "cell 1 0"); statusPanel.add(new JLabel(Messages.getString("GamePanel.status")), "cell 0 1"); statusPanel.add(mTeamLabel, "cell 1 1"); add(statusPanel, "cell 0 0, growy 0"); add(mJailPanel, "cell 0 1"); }

Target:
private void initComponents() { setLayout(new MigLayout("", "[100:pref,fill]", "[100:pref,fill]")); JPanel jailHolderPanel = new JPanel(); jailHolderPanel.setOpaque(false); jailHolderPanel.add(mJailPanel); jailHolderPanel.addComponentListener(new ComponentListener() { @Override public void componentResized(ComponentEvent e) { mJailPanel.updateDimensions(e.getComponent().getWidth(), e.getComponent().getHeight()); } @Override public void componentMoved(ComponentEvent e) { } @Override public void componentShown(ComponentEvent e) { } @Override public void componentHidden(ComponentEvent e) { } }); JPanel statusPanel = new JPanel(); statusPanel.setOpaque(false); statusPanel.setLayout(new MigLayout("", "[50:pref]", "[pref!]")); statusPanel.add(new JLabel(Messages.getString("GamePanel.player")), "cell 0 0"); statusPanel.add(mPlayerName, "cell 1 0"); statusPanel.add(new JLabel(Messages.getString("GamePanel.status")), "cell 0 1"); statusPanel.add(mTeamLabel, "cell 1 1"); add(statusPanel, "cell 0 0, growy 0"); add(jailHolderPanel, "cell 0 1"); }
Source:
private Set<GlusterServerInfo> fetchServers(VDS upServer, List<VDS> existingServers) { Set<GlusterServerInfo> fetchedServers = null; while (fetchedServers == null && existingServers.size() > 0) { fetchedServers = fetchServers(upServer); if (fetchedServers == null) { logServerMessage(upServer, AuditLogType.GLUSTER_SERVERS_LIST_FAILED); setNonOperational(upServer); existingServers.remove(upServer); upServer = getNewUpServer(existingServers, upServer); } } return fetchedServers; }

Target:
private Set<GlusterServerInfo> fetchServers(VDS upServer, List<VDS> existingServers) { Set<GlusterServerInfo> fetchedServers = null; while (fetchedServers == null && !existingServers.isEmpty()) { fetchedServers = fetchServers(upServer); if (fetchedServers == null) { logServerMessage(upServer, AuditLogType.GLUSTER_SERVERS_LIST_FAILED); setNonOperational(upServer); existingServers.remove(upServer); upServer = getNewUpServer(existingServers, upServer); } } return fetchedServers; }
Source:
public String toString() { final String revisionName = sha1 != null ? sha1.name() : "null"; StringBuilder s = new StringBuilder("Revision " + revisionName + " ("); if (branches != null) { Joiner.on(", ").appendTo(s, Iterables.transform(branches, (Branch from) -> Util.fixNull(from.getName()))); } s.append(')'); return s.toString(); }

Target:
public String toString() { final String revisionName = sha1 != null ? sha1.name() : "null"; StringBuilder s = new StringBuilder("Revision " + revisionName + " ("); if (branches != null) { Joiner.on(", ").appendTo(s, Iterables.transform(branches, from -> Util.fixNull(from.getName()))); } s.append(')'); return s.toString(); }
Source:
public boolean isValidColumnOrder(ColumnOrder columnOrder) { return columnOrder.getColumnOrderName() == UNDEFINED || columnOrder.getColumnOrderName() == TYPE_DEFINED_ORDER; }

Target:
boolean isValidColumnOrder(ColumnOrder columnOrder) { return columnOrder.getColumnOrderName() == UNDEFINED || columnOrder.getColumnOrderName() == TYPE_DEFINED_ORDER; }
Source:
public void initialise() { particleUpdater = ParticleUpdater.create(physics); }

Target:
public void initialise() { particleUpdater = ParticleUpdater.create(physics); registerGeneratorFunction(new EnergyRangeGeneratorFunction()); registerGeneratorFunction(new VelocityRangeGeneratorFunction()); registerGeneratorFunction(new ColorRangeGeneratorFunction()); registerGeneratorFunction(new PositionRangeGeneratorFunction()); registerGeneratorFunction(new ScaleRangeGeneratorFunction()); registerGeneratorFunction(new TextureOffsetGeneratorFunction()); registerAffectorFunction(new VelocityAffectorFunction()); registerAffectorFunction(new AccelerationAffectorFunction()); }
Source:
public IStatus validate(IValidationContext ctx) { IStatus status = null; EObject target = ctx.getTarget(); for (EObject content : target.eContents()) { if (content instanceof IdentifiedElement && !(content instanceof Group || content instanceof ViewpointSpec)) { String elementName = ((IdentifiedElement) content).getName(); if (StringUtil.isEmpty(elementName)) { status = ctx.createFailureStatus(getPath(content) + ERROR_MESSAGE); } } } if (status == null) { status = ctx.createSuccessStatus(); } return status; }

Target:
public IStatus validate(IValidationContext ctx) { IStatus status = null; EObject target = ctx.getTarget(); for (EObject content : target.eContents()) { if (content instanceof IdentifiedElement) { String elementName = ((IdentifiedElement) content).getName(); if (StringUtil.isEmpty(elementName)) { status = ctx.createFailureStatus(getPath(content) + ERROR_MESSAGE); } } } if (status == null) { status = ctx.createSuccessStatus(); } return status; }
Source:
public Map<Object, Object> readValueFrom(StreamInput in) throws IOException { if (in.readBoolean()) { int size = in.readInt(); HashMap<Object, Object> m = new HashMap<>(size); for (int i = 0; i < size; i++) { Object key = UndefinedType.INSTANCE.streamer().readValueFrom(in); Object val = UndefinedType.INSTANCE.streamer().readValueFrom(in); m.put(key, val); } return m; } return null; }

Target:
public Map<Object, Object> readValueFrom(StreamInput in) throws IOException { if (in.readBoolean()) { int size = in.readInt(); HashMap<Object, Object> m = new HashMap<>(size); for (int i = 0; i < size; i++) { Object key = in.readGenericValue(); Object val = in.readGenericValue(); m.put(key, val); } return m; } return null; }
Source:
public void before() { String tableName = UUID.randomUUID().toString().substring(0, 16).replace("-", "X"); lockWatcher.setTable(tableName); this.tableReference = TableReference.create(SimpleEteLockWatchResource.NAMESPACE, tableName); }

Target:
public void before() { String tableName = UUID.randomUUID().toString().substring(0, 16).replace("-", "_"); lockWatcher.setTable(tableName); this.tableReference = TableReference.create(SimpleEteLockWatchResource.NAMESPACE, tableName); }
Source:
private boolean isVerticalConnector() { return this == CORNER || this == VLINE; }

Target:
private boolean isVerticalConnector() { return this == CORNER || this == VERTICAL_WALL; }
Source:
private void runStartupRules() { if (triggerManager != null) { Iterable<Rule> startupRules = triggerManager.getRules(STARTUP); for (Rule rule : startupRules) { scheduler.schedule(() -> { try { Script script = scriptEngine.newScriptFromXExpression(rule.getScript()); logger.debug("Executing startup rule '{}'", rule.getName()); RuleEvaluationContext context = new RuleEvaluationContext(); context.setGlobalContext(RuleContextHelper.getContext(rule, injector)); script.execute(context); triggerManager.removeRule(STARTUP, rule); } catch (ScriptExecutionException e) { if (!e.getMessage().contains("cannot be resolved to an item or type")) { logger.error("Error during the execution of startup rule '{}': {}", new Object[] { rule.getName(), e.getCause().getMessage() }); triggerManager.removeRule(STARTUP, rule); } else { logger.debug( "Execution of startup rule '{}' has been postponed as items are still missing: {}", rule.getName(), e.getMessage()); } } }, 0, TimeUnit.SECONDS); } starting = false; triggerManager.startTimerRuleExecution(); } }

Target:
private void runStartupRules() { if (triggerManager != null) { Iterable<Rule> startupRules = triggerManager.getRules(STARTUP); for (Rule rule : startupRules) { scheduler.execute(() -> { try { Script script = scriptEngine.newScriptFromXExpression(rule.getScript()); logger.debug("Executing startup rule '{}'", rule.getName()); RuleEvaluationContext context = new RuleEvaluationContext(); context.setGlobalContext(RuleContextHelper.getContext(rule, injector)); script.execute(context); triggerManager.removeRule(STARTUP, rule); } catch (ScriptExecutionException e) { if (!e.getMessage().contains("cannot be resolved to an item or type")) { logger.error("Error during the execution of startup rule '{}': {}", new Object[] { rule.getName(), e.getCause().getMessage() }); triggerManager.removeRule(STARTUP, rule); } else { logger.debug( "Execution of startup rule '{}' has been postponed as items are still missing: {}", rule.getName(), e.getMessage()); } } }); } starting = false; triggerManager.startTimerRuleExecution(); } }
Source:
private boolean supportedRexCall(RexCall call) { final SqlSyntax syntax = call.getOperator().getSyntax(); switch (syntax) { case BINARY: switch (call.getKind()) { case AND: case OR: case LIKE: case EQUALS: case NOT_EQUALS: case GREATER_THAN: case GREATER_THAN_OR_EQUAL: case LESS_THAN: case LESS_THAN_OR_EQUAL: return true; default: return false; } case SPECIAL: switch (call.getKind()) { case CAST: case LIKE: case OTHER_FUNCTION: case ITEM: return true; case CASE: case SIMILAR: default: return false; } case FUNCTION: return true; case POSTFIX: switch (call.getKind()) { case IS_NOT_NULL: case IS_NULL: return true; } case PREFIX: switch (call.getKind()) { case NOT: return true; } case FUNCTION_ID: case FUNCTION_STAR: default: return false; } }

Target:
private boolean supportedRexCall(RexCall call) { final SqlSyntax syntax = call.getOperator().getSyntax(); switch (syntax) { case BINARY: switch (call.getKind()) { case AND: case OR: case LIKE: case EQUALS: case NOT_EQUALS: case GREATER_THAN: case GREATER_THAN_OR_EQUAL: case LESS_THAN: case LESS_THAN_OR_EQUAL: return true; default: return false; } case SPECIAL: switch (call.getKind()) { case CAST: case LIKE: case ITEM: case OTHER_FUNCTION: return true; case CASE: case SIMILAR: default: return false; } case FUNCTION: return true; case POSTFIX: switch (call.getKind()) { case IS_NOT_NULL: case IS_NULL: return true; } case PREFIX: switch (call.getKind()) { case NOT: return true; } case FUNCTION_ID: case FUNCTION_STAR: default: return false; } }
Source:
public CTFCallsite getCallsite(String eventName, long ip) { final LinkedList<CTFCallsite> candidates = callsitesByName.get(eventName); final CTFCallsite dummyCs = new CTFCallsite(null, null, ip, null, -1); final int pos = Collections.binarySearch(candidates, dummyCs) + 1; if (pos >= candidates.size()) { return null; } if (pos == -1) { if (ip > candidates.getLast().getIp()) { return candidates.getLast(); } return candidates.getFirst(); } return candidates.get(pos); }

Target:
public CTFCallsite getCallsite(String eventName, long ip) { final LinkedList<CTFCallsite> candidates = callsitesByName.get(eventName); final CTFCallsite dummyCs = new CTFCallsite(null, null, ip, null, -1); final int pos = Collections.binarySearch(candidates, dummyCs) + 1; if (pos >= candidates.size()) { return null; } if (pos < 0) { if (candidates.size() > -pos) { return candidates.get(-pos); } return candidates.getFirst(); } return candidates.get(pos); }
Source:
public GlusterVolumeSnapshotConfigReturnForXmlRpc(Guid clusterId, Map<String, Object> innerMap) { super(innerMap); status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS)); Map<String, Object> systemConfig = (Map<String, Object>) innerMap.get(SYSTEM_CONFIG); glusterSnapshotConfigInfo.setClusterId(clusterId); Map<String, String> clusterConfigs = new HashMap<String, String>(); for (String key : systemConfig.keySet()) { String value = (String) systemConfig.get(key); clusterConfigs.put(key, value == null ? "" : value); } glusterSnapshotConfigInfo.setClusterConfigOptions(clusterConfigs); glusterSnapshotConfigInfo.setVolumeConfigOptions(parseVolumeConfigDetails((Map<String, Object>) innerMap.get(VOLUME_CONFIG))); }

Target:
public GlusterVolumeSnapshotConfigReturnForXmlRpc(Guid clusterId, Map<String, Object> innerMap) { super(innerMap); status = new StatusForXmlRpc((Map<String, Object>) innerMap.get(STATUS)); Map<String, Object> systemConfig = (Map<String, Object>) innerMap.get(SYSTEM_CONFIG); Map<String, String> clusterConfigs = new HashMap<String, String>(); for (String key : systemConfig.keySet()) { String value = (String) systemConfig.get(key); clusterConfigs.put(key, value == null ? "" : value); } glusterSnapshotConfigInfo.setClusterConfigOptions(clusterConfigs); glusterSnapshotConfigInfo.setVolumeConfigOptions(parseVolumeConfigDetails((Map<String, Object>) innerMap.get(VOLUME_CONFIG))); }
Source:
protected Guid getDataCenterId(Network network) { return getEntity(StoragePool.class, VdcQueryType.GetStoragePoolByDatacenterName, new NameQueryParameters(network.getDataCenter().getName()), "Datacenter: name=" + network.getDataCenter().getName()).getId(); }

Target:
protected Guid getDataCenterId(Network network) { String networkName = network.getDataCenter().getName(); return getEntity(StoragePool.class, VdcQueryType.GetStoragePoolByDatacenterName, new NameQueryParameters(networkName), "Datacenter: name=" + networkName).getId(); }
Source:
protected String getBannerTitle() { return "Sign In / Register"; }

Target:
protected String getBannerTitle() { return getWindowTitle(); }
Source:
public boolean getGlobalListConflicts(List<UserList> project1GlobalLists, List<UserList> project2GlobalLists) { List<UserList> conflicts = new ArrayList<>(); for (UserList project1GlobalList : project1GlobalLists) { for (UserList project2GlobalList : project2GlobalLists) { if (project1GlobalList.getName().equals(project2GlobalList.getName()) && !project1GlobalList.getList() .equals(project2GlobalList.getList())) { conflicts.add(project1GlobalList); } } } return conflicts.isEmpty(); }

Target:
public boolean getGlobalListConflicts(List<UserList> project1GlobalLists, List<UserList> project2GlobalLists) { List<UserList> conflicts = new ArrayList<>(); for (UserList project1GlobalList : project1GlobalLists) { for (UserList project2GlobalList : project2GlobalLists) { if (project1GlobalList.getName().equals(project2GlobalList.getName())) { conflicts.add(project1GlobalList); } } } return !conflicts.isEmpty(); }
Source:
public void removeSpace(String spaceId) { String bucketName = getBucketName(spaceId); String propertiesBucketName = getBucketName(PROPERTIES_BUCKET); try { s3Client.deleteBucket(bucketName); } catch (AmazonClientException e) { String err = "Could not delete S3 bucket with name " + bucketName + " due to error: " + e.getMessage(); throw new StorageException(err, e, RETRY); } s3Client.deleteObject(propertiesBucketName, spaceId); }

Target:
public void removeSpace(String spaceId) { String bucketName = getBucketName(spaceId); String propertiesBucketName = getBucketName(PROPERTIES_BUCKET); try { s3Client.deleteBucket(bucketName); } catch (AmazonClientException e) { String err = "Could not delete Swift container with name " + bucketName + " due to error: " + e.getMessage(); throw new StorageException(err, e, RETRY); } s3Client.deleteObject(propertiesBucketName, spaceId); }
Source:
public void checkRead(String file) { if (base != null) { super.checkRead(file); } }

Target:
public void checkRead(String file) { if (base != null) { base.checkRead(file); } }
Source:
protected void drawForeground(final int mouseX, final int mouseY) { super.drawForeground(mouseX, mouseY); if (storageEntity.isEmpty()) { font.draw("Empty", 10, 20, 4210752); } else { font.draw("Storing:", 10, 20, 4210752); font.draw(storageEntity.getStoredStack().getName().asString(), 10, 30, 4210752); font.draw("Amount:", 10, 50, 4210752); font.draw(String.valueOf(storageEntity.getCurrentCapacity()), 10, 60, 4210752); String percentFilled = String.valueOf((int) ((double) storageEntity.getCurrentCapacity() / (double) storageEntity.getMaxCapacity() * 100)); font.draw("Used: " + percentFilled + "%", 10, 70, 4210752); font.draw("Wrench unit to retain contents", 10, 80, 16711680); } }

Target:
protected void drawForeground(final int mouseX, final int mouseY) { super.drawForeground(mouseX, mouseY); if (storageEntity.isEmpty()) { font.draw(StringUtils.t("techreborn.tooltip.unit.empty"), 10, 20, 4210752); } else { font.draw(StringUtils.t("gui.techreborn.storage.store"), 10, 20, 4210752); font.draw(storageEntity.getStoredStack().getName().asString(), 10, 30, 4210752); font.draw(StringUtils.t("gui.techreborn.storage.amount"), 10, 50, 4210752); font.draw(String.valueOf(storageEntity.getCurrentCapacity()), 10, 60, 4210752); String percentFilled = String.valueOf((int) ((double) storageEntity.getCurrentCapacity() / (double) storageEntity.getMaxCapacity() * 100)); font.draw(StringUtils.t("gui.techreborn.unit.used") + percentFilled + "%", 10, 70, 4210752); font.draw(StringUtils.t("gui.techreborn.unit.wrenchtip"), 10, 80, 16711680); } }
Source:
public ConfigDef config() { return null; }

Target:
public ConfigDef config() { throw new ConnectException(PredicatedTransformation.class.getName() + ".config() " + "should never be called directly."); }