auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addWriter(String owner, PublicKeyHash writer) { try (PreparedStatement insert = conn.prepareStatement(commands.insertOrIgnoreCommand("INSERT ", "INTO writers (key_hash) VALUES(?)"))) { insert.setBytes(1, writer.toBytes()); insert.executeUpdate(); } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new RuntimeException(sqe); } int userId = getUserId(owner); int writerId = getWriterId(writer); try (PreparedStatement insert = conn.prepareStatement(commands.insertOrIgnoreCommand("INSERT ", "INTO writerusage (writer_id, user_id, direct_size) VALUES(?, ?, ?)"))) { insert.setInt(1, writerId); insert.setInt(2, userId); insert.setInt(3, 0); insert.executeUpdate(); } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new RuntimeException(sqe); } }

Target:
public void addWriter(String owner, PublicKeyHash writer) { try (Connection conn = getConnection(); PreparedStatement writerInsert = conn.prepareStatement(commands.insertOrIgnoreCommand("INSERT ", "INTO writers (key_hash) VALUES(?)")); PreparedStatement userSelect = conn.prepareStatement("SELECT id FROM users WHERE name = ?;"); PreparedStatement writerSelect = conn.prepareStatement("SELECT id FROM writers WHERE key_hash = ?;"); PreparedStatement usageInsert = conn.prepareStatement(commands.insertOrIgnoreCommand("INSERT ", "INTO writerusage (writer_id, user_id, direct_size) VALUES(?, ?, ?)"))) { writerInsert.setBytes(1, writer.toBytes()); writerInsert.executeUpdate(); userSelect.setString(1, owner); ResultSet resultSet = userSelect.executeQuery(); resultSet.next(); int userId = resultSet.getInt(1); writerSelect.setBytes(1, writer.toBytes()); ResultSet writerRes = writerSelect.executeQuery(); writerRes.next(); int writerId = writerRes.getInt(1); usageInsert.setInt(1, writerId); usageInsert.setInt(2, userId); usageInsert.setInt(3, 0); usageInsert.executeUpdate(); } catch (SQLException sqe) { LOG.log(Level.WARNING, sqe.getMessage(), sqe); throw new RuntimeException(sqe); } }
Source:
private static String md5(byte[] buffer) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(buffer); byte[] digest = md.digest(); return new String(FlexBase64.encodeBytes(digest, 0, digest.length, false), Charset.forName("US-ASCII")); } catch (NoSuchAlgorithmException e) { throw new InternalError("MD5 not supported on this platform"); } }

Target:
private static String md5(byte[] buffer) { try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(buffer); byte[] digest = md.digest(); return new String(FlexBase64.encodeBytes(digest, 0, digest.length, false), StandardCharsets.US_ASCII); } catch (NoSuchAlgorithmException e) { throw new InternalError("MD5 not supported on this platform"); } }
Source:
private OptionElement readOption(char keyValueSeparator) { boolean isExtension = (peekChar() == '['); boolean isParenthesized = (peekChar() == '('); String name = readName(); if (isExtension) { name = "[" + name + "]"; } String subName = null; char c = readChar(); if (c == '.') { subName = readName(); c = readChar(); } if (c != keyValueSeparator) { throw unexpected("expected '" + keyValueSeparator + "' in option"); } Object value = readValue(); Object valueOrSubOption = subName != null ? OptionElement.create(subName, value) : value; return OptionElement.create(name, valueOrSubOption); }

Target:
private OptionElement readOption(char keyValueSeparator) { boolean isExtension = (peekChar() == '['); boolean isParenthesized = (peekChar() == '('); String name = readName(); if (isExtension) { name = "[" + name + "]"; } String subName = null; char c = readChar(); if (c == '.') { subName = readName(); c = readChar(); } if (c != keyValueSeparator) { throw unexpected("expected '" + keyValueSeparator + "' in option"); } Object value = readValue(); Object valueOrSubOption = subName != null ? OptionElement.create(subName, value) : value; return OptionElement.create(name, valueOrSubOption, isParenthesized); }
Source:
public void handleRecordMessage( Value[] fields ) { StreamCollector collector = collectors.get( responseId ); if ( collector != null ) { collector.record( fields ); } logger.debug( "S: RecordMessage{%s}", Arrays.asList( fields ) ); }

Target:
public void handleRecordMessage( Value[] fields ) { StreamCollector collector = collectors.get( responseId ); if ( collector != null ) { collector.record( fields ); } }
Source:
protected Value<Boolean> constructValue(Boolean actualValue) { return new SpongeValue<>(Keys.IS_ADULT, false, actualValue); }

Target:
protected Value<Boolean> constructValue(Boolean actualValue) { return new SpongeValue<>(Keys.IS_ADULT, true, actualValue); }
Source:
public String getRecipientNames(Set<String> recipients, String courseId, String studentEmail, CourseRoster roster) { StringBuilder namesStringBuilder = new StringBuilder(); int i = 0; for (String recipient : recipients) { if (i == recipients.size() - 1 && recipients.size() > 1) { namesStringBuilder.append(" and "); } else if ( i > 0 && i < recipients.size() - 1 && recipients.size() > 2) { namesStringBuilder.append(", "); } StudentAttributes student = roster.getStudentForEmail(recipient); if (studentEmail != null && recipient.equals(studentEmail)) { namesStringBuilder.append("you"); } else if (courseId.equals(recipient)) { namesStringBuilder.append("All Students In This Course"); } else if(student != null){ if (recipients.size() == 1) { namesStringBuilder.append(student.name + " (" + student.team + ", " + student.email + ")"); } else { namesStringBuilder.append(student.name); } } else { namesStringBuilder.append(recipient); } i++; } String namesString = namesStringBuilder.toString(); return namesString; }

Target:
public String getRecipientNames(Set<String> recipients, String courseId, String studentEmail, CourseRoster roster) { StringBuilder namesStringBuilder = new StringBuilder(); int i = 0; for (String recipient : recipients) { if (i == recipients.size() - 1 && recipients.size() > 1) { namesStringBuilder.append(" and "); } else if (i > 0 && i < recipients.size() - 1 && recipients.size() > 2) { namesStringBuilder.append(", "); } StudentAttributes student = roster.getStudentForEmail(recipient); if (studentEmail != null && recipient.equals(studentEmail)) { namesStringBuilder.append("you"); } else if (courseId.equals(recipient)) { namesStringBuilder.append("all students in this course"); } else if (student != null) { if (recipients.size() == 1) { namesStringBuilder.append(student.name + " (" + student.team + ", " + student.email + ")"); } else { namesStringBuilder.append(student.name); } } else { namesStringBuilder.append(recipient); } i++; } String namesString = namesStringBuilder.toString(); return namesString; }
Source:
protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); container.setLayout(new GridLayout(2, false)); Label filterLabel = new Label(container, SWT.NONE); filterLabel.setText(Messages.FilterInputDialog_filter_input_label); textFilter = new Text(container, SWT.BORDER); textFilter.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); textFilter.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { checkInput(); } }); Label placeholder = new Label(container, SWT.NONE); placeholder.setText(""); Label noteLabel = new Label(container, SWT.NONE); noteLabel.setText(Messages.FilterInputDialog_note_label); return area; }

Target:
protected Control createDialogArea(Composite parent) { Composite area = (Composite) super.createDialogArea(parent); Composite container = new Composite(area, SWT.NONE); container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); container.setLayout(new GridLayout(2, false)); Label filterLabel = new Label(container, SWT.NONE); filterLabel.setText(Messages.FilterInputDialog_filter_input_label); textFilter = new Text(container, SWT.BORDER); textFilter.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false)); textFilter.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { checkInput(); } }); new Label(container, SWT.NONE); Label noteLabel = new Label(container, SWT.NONE); noteLabel.setText(Messages.FilterInputDialog_note_label); return area; }
Source:
public URI toURI(String path) { try { if (project.hasNature(SYNC_NATURE)) return remoteRes.getActiveLocationURI(); } catch (CoreException e) { e.printStackTrace(); } return manager.toURI(path); }

Target:
public URI toURI(String path) { return manager.toURI(path); }
Source:
public LocalDateTime toLocalDateTimeBin(byte[] bytes) throws PSQLException { if (bytes.length != 8) { throw new PSQLException(GT.tr("Unsupported binary encoding of {0}.", "timestamp"), PSQLState.BAD_DATETIME_FORMAT); } long secs; int nanos; if (usesDouble) { double time = ByteConverter.float8(bytes, 0); if (time == Double.POSITIVE_INFINITY) { return LocalDateTime.MAX; } else if (time == Double.NEGATIVE_INFINITY) { return LocalDateTime.MIN; } secs = (long) time; nanos = (int) ((time - secs) * 1000000); } else { long time = ByteConverter.int8(bytes, 0); if (time == Long.MAX_VALUE) { return LocalDateTime.MAX; } else if (time == Long.MIN_VALUE) { return LocalDateTime.MIN; } secs = time / 1000000; nanos = (int) (time - secs * 1000000); } if (nanos < 0) { secs--; nanos += 1000000; } nanos *= 1000; secs = toJavaSecs(secs); return LocalDateTime.ofEpochSecond(secs, nanos, ZoneOffset.UTC); }

Target:
public LocalDateTime toLocalDateTimeBin(byte[] bytes) throws PSQLException { ParsedBinaryTimestamp parsedTimestamp = this.toParsedTimestampBin(null, bytes, true); if (parsedTimestamp.infinity == Infinity.POSITIVE) { return LocalDateTime.MAX; } else if (parsedTimestamp.infinity == Infinity.NEGATIVE) { return LocalDateTime.MAX; } return LocalDateTime.ofEpochSecond(parsedTimestamp.millis / 1000L, parsedTimestamp.nanos, ZoneOffset.UTC); }
Source:
private synchronized void reloadData() { _allDatastreamTasks = new HashMap<>(); List<String> connectorTypes = _zkclient.getChildren(_path); connectorTypes.forEach(connectorType -> { if (!_allDatastreamTasks.containsKey(connectorType)) { _allDatastreamTasks.put(connectorType, new ArrayList<>()); } String path = KeyBuilder.connector(_cluster, connectorType); List<String> tasksForConnector = _zkclient.getChildren(path); tasksForConnector.forEach(taskName -> { String p = KeyBuilder.connectorTask(_cluster, connectorType, taskName); String content = _zkclient.ensureReadData(p); DatastreamTask t = DatastreamTask.fromJson(content); _allDatastreamTasks.get(connectorType).add(t); }); }); }

Target:
private synchronized void reloadData() { _allDatastreamTasks = new HashMap<>(); List<String> connectorTypes = _zkclient.getChildren(_path); for (String connectorType: connectorTypes) { if (!_allDatastreamTasks.containsKey(connectorType)) { _allDatastreamTasks.put(connectorType, new ArrayList<>()); } String path = KeyBuilder.connector(_cluster, connectorType); List<String> tasksForConnector = _zkclient.getChildren(path); for (String taskName: tasksForConnector) { String p = KeyBuilder.connectorTask(_cluster, connectorType, taskName); String content = _zkclient.ensureReadData(p); DatastreamTask t = DatastreamTask.fromJson(content); _allDatastreamTasks.get(connectorType).add(t); } } }
Source:
public String describeFirstNonRequestableCapability() { final long nonRequestable = (mNetworkCapabilities & NON_REQUESTABLE_CAPABILITIES); if (nonRequestable != 0) { return capabilityNameOf(BitUtils.unpackBits(nonRequestable)[0]); } if (mLinkUpBandwidthKbps != 0 || mLinkDownBandwidthKbps != 0) return "link bandwidth"; if (hasSignalStrength()) return "signalStrength"; return null; }

Target:
public String describeFirstNonRequestableCapability() { final long nonRequestable = (mNetworkCapabilities | mUnwantedNetworkCapabilities) & NON_REQUESTABLE_CAPABILITIES; if (nonRequestable != 0) { return capabilityNameOf(BitUtils.unpackBits(nonRequestable)[0]); } if (mLinkUpBandwidthKbps != 0 || mLinkDownBandwidthKbps != 0) return "link bandwidth"; if (hasSignalStrength()) return "signalStrength"; return null; }
Source:
public void shouldMapAllFieldsInGtf() throws Exception { GeneLineMapper lineMapper = new GeneLineMapper(); for (String gtfLine : GtfStaticTestData.GTF_CONTENT.split(GtfStaticTestData.GTF_LINE_SPLIT)) { if (!gtfLine.startsWith(GtfStaticTestData.GTF_COMMENT_LINE)) { FeatureCoordinates gene = lineMapper.mapLine(gtfLine, 0); assertNotNull(gene.getChromosome()); } } }

Target:
public void shouldMapAllFieldsInGtf() throws Exception { GeneLineMapper lineMapper = new GeneLineMapper(); for (String gtfLine : GtfStaticTestData.GTF_CONTENT.split(GtfStaticTestData.GTF_LINE_SPLIT)) { if (!gtfLine.startsWith(GtfStaticTestData.GTF_COMMENT_LINE)) { FeatureCoordinates gene = lineMapper.mapLine(gtfLine, 0); assertNotNull(gene.getId()); assertNotNull(gene.getChromosome()); assertNotNull(gene.getStart()); assertNotNull(gene.getEnd()); } } }
Source:
public static void installDummyPlugin() throws Exception { RestAssured.baseURI = "http://" + System.getProperty("rest.server","localhost") ; RestAssured.port = 7080; RestAssured.basePath = "/rest/"; RestAssured.authentication = basic("rhqadmin","rhqadmin"); InputStream in = PluginsTest.class.getClassLoader().getResourceAsStream("dummy-rhq-plugin.xml"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int data; while ((data = in.read())!=-1) { baos.write(data); } byte[] bytes = baos.toByteArray(); in.close(); baos.close(); String handle = given() .auth().preemptive().basic("rhqadmin", "rhqadmin") .body(bytes) .contentType(ContentType.BINARY) .header(acceptJson) .expect() .statusCode(201) .log().ifError() .when() .post("/content/fresh").body().path("value"); @SuppressWarnings("unchecked") Map<String, Object> plugin = given() .header(acceptJson) .param("handle", handle) .param("name", "dummy-rhq-plugin.xml") .expect() .statusCode(200) .log().ifError() .when() .put("/plugins").jsonPath().get("find { p -> p.name == 'Dummy' }"); Assert.assertEquals(plugin.get("name"), "Dummy"); DUMMY_PLUGIN_ID = (Integer) plugin.get("id"); }

Target:
public static void installDummyPlugin() throws Exception { setupRestAssured(); InputStream in = PluginsTest.class.getClassLoader().getResourceAsStream("dummy-rhq-plugin.xml"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); int data; while ((data = in.read())!=-1) { baos.write(data); } byte[] bytes = baos.toByteArray(); in.close(); baos.close(); String handle = given() .auth().preemptive().basic("rhqadmin", "rhqadmin") .body(bytes) .contentType(ContentType.BINARY) .header(acceptJson) .expect() .statusCode(201) .log().ifError() .when() .post("/content/fresh").body().path("value"); @SuppressWarnings("unchecked") Map<String, Object> plugin = given() .header(acceptJson) .param("handle", handle) .param("name", "dummy-rhq-plugin.xml") .expect() .statusCode(200) .log().ifError() .when() .put("/plugins").jsonPath().get("find { p -> p.name == 'Dummy' }"); Assert.assertEquals(plugin.get("name"), "Dummy"); DUMMY_PLUGIN_ID = (Integer) plugin.get("id"); }
Source:
private Result<?> calculate(CalculationMarketData calculationData) { ImmutableSet<Measure> measures = ImmutableSet.of(getMeasure()); Map<Measure, Result<ScenarioResult<?>>> map = function.calculate(target, measures, calculationData); if (!map.containsKey(getMeasure())) { return Result.failure( FailureReason.CALCULATION_FAILED, "Function '{}' did not return requested measure '{}'", function.getClass().getName(), getMeasure()); } return map.get(getMeasure()); }

Target:
private Result<?> calculate(CalculationMarketData calculationData) { ImmutableSet<Measure> measures = ImmutableSet.of(getMeasure()); Map<Measure, Result<?>> map = function.calculate(target, measures, calculationData); if (!map.containsKey(getMeasure())) { return Result.failure( FailureReason.CALCULATION_FAILED, "Function '{}' did not return requested measure '{}'", function.getClass().getName(), getMeasure()); } return map.get(getMeasure()); }
Source:
private static String getYarnApiAddress(Configuration conf) { Set<String> yarnApiAddresses = getYarnApiAddresses(conf); try { for (String yarnApiAddress : yarnApiAddresses) { if (successfulConnection(yarnApiAddress)) { return yarnApiAddress; } } } catch (IOException e) { LOG.error("Error getting yarn api address:", e); } return ""; }

Target:
private static Optional<String> getYarnApiAddress(Configuration conf) { Set<String> yarnApiAddresses = getYarnApiAddresses(conf); try { for (String yarnApiAddress : yarnApiAddresses) { if (successfulConnection(yarnApiAddress)) { return Optional.of(yarnApiAddress); } } } catch (IOException e) { LOG.error("Error getting yarn api address:", e); } return Optional.empty(); }
Source:
public void tearDown() { for (Entry<String, TransportClient> entry : clients.entrySet()) { entry.getValue().close(); } clients.clear(); tableColumns.clear(); }

Target:
public void tearDown() { try (Closer closer = Closer.create()) { for (Entry<String, TransportClient> entry : clients.entrySet()) { closer.register(entry.getValue()); } closer.register(clients::clear); closer.register(() -> executor.shutdown()); } catch (IOException e) { throw new UncheckedIOException(e); } }
Source:
private VoltDBLAggregate( RelOptCluster cluster, RelTraitSet traitSet, RelNode child, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { super(cluster, traitSet, child, indicator, groupSet, groupSets, aggCalls); }

Target:
private VoltDBLAggregate( RelOptCluster cluster, RelTraitSet traitSet, RelNode child, boolean indicator, ImmutableBitSet groupSet, List<ImmutableBitSet> groupSets, List<AggregateCall> aggCalls) { super(cluster, traitSet, child, indicator, groupSet, groupSets, aggCalls); assert traitSet.contains(VoltDBLRel.VOLTDB_LOGICAL); }
Source:
public GraphMLReader create() { if (this.xmlInputFactory() == null) { this.inputFactory = XMLInputFactory.newInstance(); } return new GraphMLReader(this); }

Target:
public GraphMLReader create() { if (this.inputFactory == null) { this.inputFactory = XMLInputFactory.newInstance(); } return new GraphMLReader(this); }
Source:
protected final SocketSession getConnectionFromState(final MultiConnectionState state) { if (this.getParentServer() == null) { LOG.info("null parent"); return null; } return this.getParentServer().getIdToConnection().get(state); }

Target:
protected final SocketSession getConnectionFromState(final MultiConnectionState state) { if (this.getParentServer() == null) { LOG.info("parent server does not exist and is null"); return null; } return this.getParentServer().getIdToConnection().get(state); }
Source:
public void setVisibility_throwsWithMeaningfulMessage() { exception.expect(UnsupportedOperationException.class); exception.expectMessage(CoreMatchers.allOf( CoreMatchers.containsString( "Cannot change Text component visibiltiy"), CoreMatchers.containsString( "because it doesn't represent an HTML Element"))); new Text("").setVisible(false); }

Target:
public void setVisibility_throwsWithMeaningfulMessage() { exception.expect(UnsupportedOperationException.class); exception.expectMessage(CoreMatchers.allOf( CoreMatchers.containsString( "Cannot change Text component visibility"), CoreMatchers.containsString( "because it doesn't represent an HTML Element"))); new Text("").setVisible(false); }
Source:
public static void createSystemTemporaryDir() throws IOException { TMP.create(); dumpDirectory = TMP.newFolder(); }

Target:
public static void createSystemTemporaryDir() { dumpDirectory = new File( TMP, "dump" ); assertThat( dumpDirectory.mkdir() ) .isTrue(); }
Source:
public void removeAllTechJobsFor(Person tech) { if (tech == null || tech.getId() == null) { return; } getHangar().forEachUnit(u -> { if (tech == u.getTech()) { u.removeTech(); } if ((u.getRefit() != null) && (tech == u.getRefit().getTech())) { u.getRefit().setTech(null); } }); for (Part p : getParts()) { if (tech == p.getTech()) { p.setTech(null); } } for (Force f : forceIds.values()) { if (tech.getId().equals(f.getTechID())) { f.setTechID(null); } } }

Target:
public void removeAllTechJobsFor(Person tech) { if (tech == null || tech.getId() == null) { return; } getHangar().forEachUnit(u -> { if (tech.equals(u.getTech())) { u.removeTech(); } if ((u.getRefit() != null) && tech.equals(u.getRefit().getTech())) { u.getRefit().setTech(null); } }); for (Part p : getParts()) { if (tech.equals(p.getTech())) { p.setTech(null); } } for (Force f : forceIds.values()) { if (tech.getId().equals(f.getTechID())) { f.setTechID(null); } } }
Source:
abstract protected void write(Writer writer, List<PlotItem> dataset) throws IOException; @Override public void show(CollectedDataNode node) { FileDialog fileDialog = new FileDialog(getDisplay().getActiveShell(), SWT.SAVE); fileDialog.setText("Export to " + this.export_type.toUpperCase()); String[] filter = { "*." + this.export_type, "*.*" }; fileDialog.setFilterExtensions(filter); String fileName = fileDialog.open(); if (fileName != null && fileName.length() > 0) { PlotDataParser parser = new PlotDataParser(node); DataParserResult result = parser.parseEntries(); try (Writer writer = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(fileName), "UTF-8"))) { write(writer, result.dataset); } catch (IOException e) { e.printStackTrace(); } } }

Target:
abstract protected void write(Writer writer, List<PlotItem> dataset) throws IOException; @Override public void show(CollectedDataNode node) { FileDialog fileDialog = new FileDialog(getDisplay().getActiveShell(), SWT.SAVE); fileDialog.setText("Export to " + exportFormat.toUpperCase()); String[] filter = { "*." + exportFormat.toLowerCase(), "*.*" }; fileDialog.setFilterExtensions(filter); String fileName = fileDialog.open(); if (fileName != null && fileName.length() > 0) { PlotDataParser parser = new PlotDataParser(node); DataParserResult result = parser.parseEntries(); try (Writer writer = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(fileName), "UTF-8"))) { write(writer, result.dataset); } catch (IOException e) { e.printStackTrace(); } } }
Source:
public String addQueryProvider( ExecutableElement methodElement, TypeMirror providerClass, List<ClassName> entityHelperTypes) { String fieldName = nameIndex.uniqueField(methodElement.getSimpleName().toString() + "Invoker"); List<String> entityHelperNames = new ArrayList<>(); for (ClassName type : entityHelperTypes) { entityHelperNames.add(addEntityHelperField(type)); } queryProviders.add( new GeneratedQueryProvider(methodElement, fieldName, providerClass, entityHelperNames)); return fieldName; }

Target:
public String addQueryProvider( ExecutableElement methodElement, TypeMirror providerClass, List<ClassName> entityHelperTypes) { String fieldName = nameIndex.uniqueField(methodElement.getSimpleName().toString() + "Invoker"); List<String> entityHelperNames = new ArrayList<>(); for (ClassName type : entityHelperTypes) { entityHelperNames.add(addEntityHelperField(type)); } queryProviders.add(new GeneratedQueryProvider(fieldName, providerClass, entityHelperNames)); return fieldName; }
Source:
private static DB initializeDBConnection(final File saveFile, final WorldProvider dimension) { LOGGER.info("Initializing db connection..."); File file = new File(saveFile, String.format("cubes.dim%d.db", dimension.getDimension())); LOGGER.info("Connected to db at ()", file); file.getParentFile().mkdirs(); DB db = DBMaker.fileDB(file).make(); return db; }

Target:
private static DB initializeDBConnection(final File saveFile, final WorldProvider dimension) { LOGGER.info("Initializing db connection..."); File file = new File(saveFile, String.format("cubes.dim%d.db", dimension.getDimension())); LOGGER.info("Connected to db at ()", file); file.getParentFile().mkdirs(); DB db = DBMaker.fileDB(file).transactionEnable().make(); return db; }
Source:
public void reactivateMember(PerunSession sess, Member member, Group group) throws InternalErrorException, MemberNotExistsException { if (!isGroupMember(sess, group, member)) throw new MemberNotExistsException("Member does not belong to this group"); validateMemberInGroup(sess, member, group); Attribute membershipExpirationRulesAttribute = getMembershipExpirationRulesAttribute(sess, group); if (membershipExpirationRulesAttribute == null) { return; } LinkedHashMap<String, String> membershipExpirationRules = membershipExpirationRulesAttribute.valueAsMap(); LocalDate localDate = LocalDate.now(); String period = null; if (membershipExpirationRules.get(AbstractMembershipExpirationRulesModule.membershipPeriodKeyName) != null) { period = membershipExpirationRules.get(AbstractMembershipExpirationRulesModule.membershipPeriodKeyName); } try { String loaPeriod = getLoaPeriod(sess, member, membershipExpirationRules, null); if (loaPeriod != null) { period = loaPeriod; } } catch (ExtendMembershipException e) { } if (period != null) { if (period.startsWith("+")) { localDate = Utils.extendDateByPeriod(localDate, period); } else { Pattern p = Pattern.compile("([0-9]+).([0-9]+)."); Matcher m = p.matcher(period); if (!m.matches()) { throw new InternalErrorException("Wrong format of period in VO membershipExpirationRules attribute. Period: " + period); } localDate = Utils.getClosestExpirationFromStaticDate(m); } } Attribute membershipExpirationAttribute = getMemberExpiration(sess, member, group); membershipExpirationAttribute.setValue(localDate.toString()); try { getPerunBl().getAttributesManagerBl().setAttribute(sess, member, group, membershipExpirationAttribute); } catch (WrongAttributeValueException e) { throw new InternalErrorException("Wrong value: " + membershipExpirationAttribute.getValue(),e); } catch (WrongReferenceAttributeValueException | WrongAttributeAssignmentException e) { throw new InternalErrorException(e); } }

Target:
public void reactivateMember(PerunSession sess, Member member, Group group) throws InternalErrorException, MemberNotExistsException { if (!isGroupMember(sess, group, member)) throw new MemberNotExistsException("Member does not belong to this group"); validateMemberInGroup(sess, member, group); Attribute membershipExpirationAttribute = getMemberExpiration(sess, member, group); membershipExpirationAttribute.setValue(null); try { getPerunBl().getAttributesManagerBl().setAttribute(sess, member, group, membershipExpirationAttribute); } catch (WrongAttributeValueException e) { throw new InternalErrorException("Wrong value: " + membershipExpirationAttribute.getValue(),e); } catch (WrongReferenceAttributeValueException | WrongAttributeAssignmentException e) { throw new InternalErrorException(e); } try { extendMembershipInGroup(sess, member, group); } catch (ExtendMembershipException ex) { throw new InternalErrorException(ex); } }
Source:
private void setupNavigatorExpandCollapseButton() { final Button button = new Button(); button.setIcon( IconType.CHEVRON_DOWN ); button.setPull( Pull.RIGHT ); button.getElement().getStyle().setMarginTop( 10, Style.Unit.PX ); button.getElement().getStyle().setMarginBottom( 10, Style.Unit.PX ); button.addClickHandler( new ClickHandler() { @Override public void onClick( final ClickEvent clickEvent ) { if ( button.getIcon().equals( IconType.CHEVRON_DOWN ) ) { button.setIcon( IconType.CHEVRON_UP ); onExpandNavigator(); } else { button.setIcon( IconType.CHEVRON_DOWN ); onCollapseNavigator(); } } } ); if ( mode.equals( Mode.COLLAPSED ) ) { button.setIcon( IconType.CHEVRON_DOWN ); } else { button.setIcon( IconType.CHEVRON_UP ); } FlowPanel buttonContainer = new FlowPanel(); buttonContainer.getElement().getStyle().setFloat( Style.Float.RIGHT ); buttonContainer.add( button ); container.add( buttonContainer ); }

Target:
private void setupNavigatorExpandCollapseButton() { this.navigatorExpandCollapseButton.addClickHandler( new ClickHandler() { @Override public void onClick( final ClickEvent clickEvent ) { navigatorExpandCollapseButton.invertMode(); if ( navigatorExpandCollapseButton.isExpanded() ) { onExpandNavigator(); } else { onCollapseNavigator(); } } } ); FlowPanel navigatorExpandCollapseButtonContainer = new FlowPanel(); navigatorExpandCollapseButtonContainer.getElement().getStyle().setFloat( Style.Float.RIGHT ); navigatorExpandCollapseButtonContainer.add( navigatorExpandCollapseButton ); container.add( navigatorExpandCollapseButtonContainer ); }
Source:
public String getClassificationValue(ClassificationScheme classification, ExtrinsicObjectType extrinsicObject) { RegistryObjectType registryObjectType = getClassification(classification, extrinsicObject); ClassificationType classType = null; if ((registryObjectType != null) && (registryObjectType instanceof ClassificationType)) { return ((ClassificationType) registryObjectType).getNodeRepresentation(); } return null; }

Target:
public String getClassificationValue(ClassificationScheme classification, ExtrinsicObjectType extrinsicObject) { RegistryObjectType registryObjectType = getClassification(classification, extrinsicObject); if (registryObjectType != null && (registryObjectType instanceof ClassificationType)) { return ((ClassificationType) registryObjectType).getNodeRepresentation(); } return null; }
Source:
private boolean pullLatestUpstream(String path) throws MojoExecutionException { Repository localRepo; Git git = null; String previousBranch; String newBranchFull; String newBranch = "sdk-" + serverId; try { localRepo = new FileRepository(new File(path, ".git").getAbsolutePath()); git = new Git(localRepo); previousBranch = localRepo.getBranch(); checkoutAndCreateNewBranch(git, newBranch); newBranchFull = localRepo.getFullBranch(); RevCommit stash = git.stashCreate().call(); addRemoteTempRepo(git, path, newBranch); PullResult pullResult = pullFromRemote(git, newBranch); if(!pullResult.isSuccessful()){ rebaseAbort(git); checkoutBranch(git, previousBranch); failureReason = CONFLICT_MESSAGE; return false; } if (stash != null) { try { git.stashApply().setStashRef(stash.getName()).call(); checkoutBranch(git, previousBranch); mergeWithNewBranch(git, newBranchFull); return true; } catch (StashApplyFailureException e) { git.reset().setMode(ResetCommand.ResetType.HARD).setRef(previousBranch).call(); checkoutBranch(git, previousBranch); git.stashApply().setStashRef(stash.getName()).call(); failureReason = CONFLICT_MESSAGE; return false; } } else { checkoutBranch(git, previousBranch); mergeWithNewBranch(git, newBranchFull); return true; } } catch (IOException e) { failureReason = CREATING_LOCAL_REPO_ERROR; } catch (CheckoutConflictException e) { failureReason = CONFLICT_MESSAGE; } catch (GitAPIException e) { failureReason = GIT_COMMAND_ERROR; } catch (URISyntaxException e) { failureReason = CREATING_TEMP_REMOTE_ERROR; } finally { cleanUpBranchesAndRemotes(git, newBranch); } return false; }

Target:
private void pullLatestUpstream(String path) throws Exception { String newBranch = SDK_DASH + serverId; Repository localRepo = getLocalRepository(path); Git git = new Git(localRepo); userBranch = localRepo.getBranch(); checkoutAndCreateNewBranch(git, newBranch); String newBranchFull = localRepo.getFullBranch(); stash = git.stashCreate().call(); addRemoteUpstream(git, path); pullFromRemoteUpstream(git, stash, newBranch, userBranch); if (stash != null) { try { git.stashApply().setStashRef(stash.getName()).call(); checkoutBranch(git, userBranch); mergeWithNewBranch(git, newBranchFull); deleteTempBranch(git, newBranch); } catch (StashApplyFailureException e) { git.reset().setMode(ResetCommand.ResetType.HARD).setRef(userBranch).call(); checkoutBranch(git, userBranch); git.stashApply().setStashRef(stash.getName()).call(); deleteTempBranch(git, newBranch); throw new Exception(CONFLICT_MESSAGE_REASON); } } else { checkoutBranch(git, userBranch); mergeWithNewBranch(git, newBranchFull); deleteTempBranch(git, newBranch); } }
Source:
private void testContent() throws Exception { ______TS("Typical case: Log in with filled profile values"); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); ______TS("Typical case: no picture"); profilePage.editProfileThroughUi("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_EDITED); ______TS("Typical case: picture upload and edit"); profilePage.fillProfilePic("src/test/resources/images/profile_pic.png"); profilePage.uploadPicture(); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); profilePage.showPictureEditor(); profilePage.waitForUploadEditModalVisible(); profilePage.editProfilePhoto(); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyPhotoSize("295px", "295px"); JSONObject studentProfileAttributes = new JSONObject( BackDoor.getStudentProfile(TestProperties.TEST_STUDENT2_ACCOUNT)); String prevPictureKey = studentProfileAttributes.getJSONObject("studentProfile").getString("pictureKey"); verifyPictureIsPresent(prevPictureKey); }

Target:
private void testContent() throws Exception { ______TS("Typical case: Log in with filled profile values"); StudentHomePage shp = getHomePage().clickStudentLogin().loginAsStudent( TestProperties.TEST_STUDENT2_ACCOUNT, TestProperties.TEST_STUDENT2_PASSWORD); StudentProfilePage profilePage = shp.loadProfileTab(); profilePage.ensureProfileContains("Ben", "i.m.benny@gmail.tmt", "TEAMMATES Test Institute 4", "Singaporean", StudentProfileAttributes.Gender.MALE, "I am just another student :P"); ______TS("Typical case: no picture"); profilePage.editProfileThroughUi("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_EDITED); ______TS("Typical case: picture upload and edit"); profilePage.fillProfilePic("src/test/resources/images/profile_pic.png"); profilePage.uploadPicture(); profilePage.verifyStatusMessage(Const.StatusMessages.STUDENT_PROFILE_PICTURE_SAVED); profilePage.showPictureEditor(); profilePage.waitForUploadEditModalVisible(); profilePage.editProfilePhoto(); profilePage.ensureProfileContains("short.name", "e@email.tmt", "inst", "American", StudentProfileAttributes.Gender.FEMALE, "this is enough!$%&*</>"); profilePage.verifyPhotoSize("295px", "295px"); StudentProfileAttributes studentProfileAttributes = BackDoor.getStudentProfile(TestProperties.TEST_STUDENT2_ACCOUNT); assertTrue(profilePage.getProfilePicLink().contains(studentProfileAttributes.pictureKey)); }
Source:
private void renewPartitionReceiver(SystemStreamPartition ssp) { String streamId = config.getStreamId(ssp.getStream()); EventHubClientManager eventHubClientManager = perPartitionEventHubManagers.get(ssp); String offset = streamPartitionOffsets.get(ssp); Integer partitionId = ssp.getPartition().getPartitionId(); String consumerGroup = config.getStreamConsumerGroup(ssp.getSystem(), streamId); try { try { streamPartitionReceivers.get(ssp).close().get(RENEW_SHUTDOWN_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (TimeoutException te) { LOG.warn("Timeout closing existing receiver. Moving on renewing a new one", te); Util.logThreadDump("EventHubSystemConsumer.Receiver#Renew"); } PartitionReceiver receiver = eventHubClientManager.getEventHubClient() .createReceiverSync(consumerGroup, partitionId.toString(), EventPosition.fromOffset(offset, !offset.equals(EventHubSystemConsumer.START_OF_STREAM))); receiver.setPrefetchCount(prefetchCount); receiver.setReceiveTimeout(DEFAULT_EVENTHUB_RECEIVER_TIMEOUT); receiver.setReceiveHandler(streamPartitionHandlers.get(ssp)); streamPartitionReceivers.put(ssp, receiver); } catch (Exception e) { eventHubHandlerError.set(new SamzaException( String.format("Failed to recreate receiver for EventHubs after ReceiverHandlerError (ssp=%s)", ssp), e)); } }

Target:
private void renewPartitionReceiver(SystemStreamPartition ssp) { String streamId = config.getStreamId(ssp.getStream()); EventHubClientManager eventHubClientManager = perPartitionEventHubManagers.get(ssp); String offset = streamPartitionOffsets.get(ssp); Integer partitionId = ssp.getPartition().getPartitionId(); String consumerGroup = config.getStreamConsumerGroup(ssp.getSystem(), streamId); try { try { LOG.info("Closing the old receiver for ssp before renewing a new one.", ssp); streamPartitionReceivers.get(ssp).close().get(RENEW_SHUTDOWN_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS); } catch (TimeoutException te) { LOG.warn("Timeout closing existing receiver. Moving on renewing a new one", te); if (Duration.between(lastThreadDumpLogTime, Instant.now()).compareTo(MIN_THREAD_DUMP_LOG_INTERVAL) > 0) { Util.logThreadDump("EventHubSystemConsumer.Receiver#Renew"); lastThreadDumpLogTime = Instant.now(); } } PartitionReceiver receiver = eventHubClientManager.getEventHubClient() .createReceiverSync(consumerGroup, partitionId.toString(), EventPosition.fromOffset(offset, !offset.equals(EventHubSystemConsumer.START_OF_STREAM))); receiver.setPrefetchCount(prefetchCount); receiver.setReceiveTimeout(DEFAULT_EVENTHUB_RECEIVER_TIMEOUT); receiver.setReceiveHandler(streamPartitionHandlers.get(ssp)); streamPartitionReceivers.put(ssp, receiver); } catch (Exception e) { eventHubHandlerError.set(new SamzaException( String.format("Failed to recreate receiver for EventHubs after ReceiverHandlerError (ssp=%s)", ssp), e)); } }
Source:
public void removeProcess(final String processName) { synchronized (lock) { final Map<String, ManagedProcess> processes = this.processes; final ManagedProcess process = processes.get(processName); if (process == null) { ProcessLogger.ROOT_LOGGER.attemptToRemoveNonExistentProcess(processName); return; } boolean removed = processes.remove(processName) != null; processesByKey.remove(new Key(process.getAuthKey().getBytes())); if(removed) { processRemoved(processName); } lock.notifyAll(); } }

Target:
public void removeProcess(final String processName) { synchronized (lock) { final Map<String, ManagedProcess> processes = this.processes; final ManagedProcess process = processes.get(processName); if (process == null) { ProcessLogger.ROOT_LOGGER.attemptToRemoveNonExistentProcess(processName); return; } boolean removed = processes.remove(processName) != null; processesByKey.remove(new Key(process.getAuthKey().getBytes(Charset.forName("US-ASCII")))); if(removed) { processRemoved(processName); } lock.notifyAll(); } }
Source:
public void serverLauncherUsesDefaultLoggingConfig() { String startLocatorCommand = String.join(" ", "start server", "--name=" + serverName, "--dir=" + workingDir, "--disable-default-server"); gfshRule.execute(startLocatorCommand); await().untilAsserted(() -> { assertThat(serverLogFile.toFile()) .as(serverLogFile.toFile().getAbsolutePath()) .exists() .contains("Server " + serverName + " startup completed in ") .doesNotContain("java.lang.IllegalStateException: No factory method found for class"); assertThat(customLogFile.toFile()) .as(customLogFile.toFile().getAbsolutePath()) .doesNotExist(); }); }

Target:
public void serverLauncherUsesDefaultLoggingConfig() { String startServerCommand = String.join(" ", "start server", "--name=" + serverName, "--dir=" + workingDir, "--disable-default-server"); gfshRule.execute(startServerCommand); await().untilAsserted(() -> { assertThat(serverLogFile.toFile()) .as(serverLogFile.toFile().getAbsolutePath()) .exists() .contains("Server " + serverName + " startup completed in ") .doesNotContain("java.lang.IllegalStateException: No factory method found for class"); assertThat(customLogFile.toFile()) .as(customLogFile.toFile().getAbsolutePath()) .doesNotExist(); }); }
Source:
public boolean contains(@Nonnull User user) { return user.getProperty(GithubAccessTokenProperty.class) != null; }

Target:
public static boolean contains(@Nonnull User user) { return user.getProperty(GithubAccessTokenProperty.class) != null; }
Source:
public ClusteringServiceConfiguration(URI clusterUri, Map<String, PoolDefinition> pools) { if (clusterUri == null) { throw new NullPointerException("clusterUri"); } for (Entry<String, PoolDefinition> e : pools.entrySet()) { if (e.getValue().getServerResource() == null) { throw new IllegalArgumentException("Pool '" + e.getKey() + "' has no defined server resource, and no default value was supplied"); } } this.clusterUri = clusterUri; this.defaultServerResource = null; this.pools = unmodifiableMap(new HashMap<String, PoolDefinition>(pools)); }

Target:
public ClusteringServiceConfiguration(URI clusterUri, Map<String, PoolDefinition> pools) { if (clusterUri == null) { throw new NullPointerException("Cluster URI cannot be null"); } StringBuilder issues = new StringBuilder(); for (Entry<String, PoolDefinition> e : pools.entrySet()) { if (e.getValue().getServerResource() == null) { issues.append("Pool '").append(e.getKey()).append("' has no defined server resource, and no default value was supplied").append("\n"); } } if (issues.length() > 0) { throw new IllegalArgumentException(issues.toString()); } this.clusterUri = clusterUri; this.defaultServerResource = null; this.pools = unmodifiableMap(new HashMap<String, PoolDefinition>(pools)); }
Source:
public String getUsernameWithProfile() { String user = String.format("%s@%s", java.util.Objects.toString(username, ""), java.util.Objects.toString(profile, "")); return "@".equals(user) ? "N/A" : user; }

Target:
public String getUsernameWithProfile() { String user = String.format("%s@%s", Objects.toString(username, ""), Objects.toString(profile, "")); return "@".equals(user) ? "N/A" : user; }
Source:
public <K> TopicReader<K> buildTopicReaderForCollection() throws Exception { if ("clueweb".equals(collection)) { return new WebxmlTopicReader(Paths.get(topicsFile)); } else if ("gov2".equals(collection)){ return new TrecTopicReader(Paths.get(topicsFile)); } else if ("twitter".equals(collection)) { return (TopicReader<K>) new MicroblogTopicReader(Paths.get(topicsFile)); } throw new RuntimeException("Unrecognized collection " + collection); }

Target:
public <K> TopicReader<K> buildTopicReaderForCollection() throws Exception { if ("clueweb".equals(collection)) { return (TopicReader<K>) new WebxmlTopicReader(Paths.get(topicsFile)); } else if ("gov2".equals(collection)){ return (TopicReader<K>) new TrecTopicReader(Paths.get(topicsFile)); } else if ("twitter".equals(collection)) { return (TopicReader<K>) new MicroblogTopicReader(Paths.get(topicsFile)); } throw new RuntimeException("Unrecognized collection " + collection); }
Source:
void onComplete(PutOperation op) { Exception e = op.getOperationException(); String blobId = op.getBlobIdString(); if (blobId == null && e == null) { e = new RouterException("Operation failed, but exception was not set", RouterErrorCode.UnexpectedInternalError); } if (e != null) { blobId = null; routerMetrics.onPutBlobError(e); } else { notificationSystem.onBlobCreated(op.getBlobIdString(), op.getBlobProperties(), op.getUserMetadata()); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.putBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); operationCompleteCallback.completeOperation(op.getFuture(), op.getCallback(), blobId, e); }

Target:
void onComplete(PutOperation op) { Exception e = op.getOperationException(); String blobId = op.getBlobIdString(); if (blobId == null && e == null) { e = new RouterException("Operation failed, but exception was not set", RouterErrorCode.UnexpectedInternalError); routerMetrics.operationFailureWithUnsetExceptionCount.inc(); } if (e != null) { blobId = null; routerMetrics.onPutBlobError(e); } else { notificationSystem.onBlobCreated(op.getBlobIdString(), op.getBlobProperties(), op.getUserMetadata()); } routerMetrics.operationDequeuingRate.mark(); routerMetrics.putBlobOperationLatencyMs.update(time.milliseconds() - op.getSubmissionTimeMs()); operationCompleteCallback.completeOperation(op.getFuture(), op.getCallback(), blobId, e); }
Source:
private void writeIntDirect(int intValue, int index) { byte[] buf = bytes; buf[index] = (byte) ((intValue >>> 24) & 0xFF); buf[index+1] = (byte) ((intValue >>> 16) & 0xFF); buf[index+2] = (byte) ((intValue >>> 8) & 0xFF); buf[index+3] = (byte) ((intValue >>> 0) & 0xFF); }

Target:
private void writeIntDirect(int intValue, int index) { byte[] buf = bytes; buf[index] = (byte) ((intValue >>> 24) & 0xFF); buf[index+1] = (byte) ((intValue >>> 16) & 0xFF); buf[index+2] = (byte) ((intValue >>> 8) & 0xFF); buf[index+3] = (byte) (intValue & 0xFF); }
Source:
public ServerRequestInterceptor createServerRequestInterceptor(ORBInitInfo info, Codec codec) { ServiceLocator staticBaseServiceLocator = Globals.getStaticBaseServiceLocator(); if (serverRequestInterceptor == null) { OpenTracingService openTracingService = staticBaseServiceLocator.getService(OpenTracingService.class); if (openTracingService != null) { serverRequestInterceptor = new OpenTracingIiopServerInterceptor(openTracingService); } } return serverRequestInterceptor; }

Target:
public ServerRequestInterceptor createServerRequestInterceptor(ORBInitInfo info, Codec codec) { if (serverRequestInterceptor == null) { if (attemptCreation()) { serverRequestInterceptor = new OpenTracingIiopServerInterceptor(openTracingService); } } return serverRequestInterceptor; }
Source:
public void createPage(Composite comp) { try { if (page == null) { StringBuffer stringBuffer = new StringBuffer(500); stringBuffer.append("<WorkPage>"); IDynamicWidgetLayoutListener dynamicWidgetLayoutListener = null; for (IAtsWizardItem item : wizardExtensionItems) { boolean hasWizardXWidgetExtensions = item.hasWizardXWidgetExtensions(wizard.getSelectedIAtsActionableItems()); if (hasWizardXWidgetExtensions) { stringBuffer.append( "<XWidget displayName=\"--- Extra fields for " + item.getName() + " ---\" xwidgetType=\"XLabel\" horizontalLabel=\"true\" toolTip=\"These fields are available for only the team workflow specified here.\"/>"); try { if (hasWizardXWidgetExtensions) { if (item instanceof IDynamicWidgetLayoutListener) { dynamicWidgetLayoutListener = (IDynamicWidgetLayoutListener) item; } item.getWizardXWidgetExtensions(wizard.getSelectedIAtsActionableItems(), stringBuffer); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } } stringBuffer.append("</WorkPage>"); page = new XWidgetPage(stringBuffer.toString(), ATSXWidgetOptionResolver.getInstance(), dynamicWidgetLayoutListener); page.createBody(null, comp, null, xModListener, true); comp.layout(); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }

Target:
public void createPage(Composite comp) { try { if (page == null) { StringBuffer stringBuffer = new StringBuffer(500); stringBuffer.append("<WorkPage>"); IDynamicWidgetLayoutListener dynamicWidgetLayoutListener = null; for (IAtsWizardItem item : wizardExtensionItems) { boolean hasWizardXWidgetExtensions = item.hasWizardXWidgetExtensions(wizard.getSelectedIAtsActionableItems()); if (hasWizardXWidgetExtensions) { stringBuffer.append( "<XWidget displayName=\"--- Extra fields for " + item.getName() + " ---\" xwidgetType=\"XLabel\" horizontalLabel=\"true\" toolTip=\"These fields are available for only the team workflow specified here.\"/>"); try { if (item instanceof IDynamicWidgetLayoutListener) { dynamicWidgetLayoutListener = (IDynamicWidgetLayoutListener) item; } item.getWizardXWidgetExtensions(wizard.getSelectedIAtsActionableItems(), stringBuffer); } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } } stringBuffer.append("</WorkPage>"); page = new XWidgetPage(stringBuffer.toString(), ATSXWidgetOptionResolver.getInstance(), dynamicWidgetLayoutListener); page.createBody(null, comp, null, xModListener, true); comp.layout(); } } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } }