auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void setRoviDescription(LocalizedDescription localizedDescription, RoviProgramDescriptionLine roviDescription) { <START> if (roviDescription.getDescriptionType().equals("Generic Description")) { <END> localizedDescription.setShortDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals("Plot Synopsis")) { localizedDescription.setMediumDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals("Synopsis")) { localizedDescription.setLongDescription(roviDescription.getDescription().orNull()); } Optional<String> longestDescription = getLongestDescription(localizedDescription); localizedDescription.setDescription(longestDescription.orNull()); }</code><technical_language>Constants</technical_language>

Target:
private void setRoviDescription(LocalizedDescription localizedDescription, RoviProgramDescriptionLine roviDescription) { if (roviDescription.getDescriptionType().equals(GENERIC_DESCRIPTION_TYPE)) { localizedDescription.setShortDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals(PLOT_SYNOPSIS_TYPE)) { localizedDescription.setMediumDescription(roviDescription.getDescription().orNull()); } else if (roviDescription.getDescriptionType().equals(SYNOPSIS_TYPE)) { localizedDescription.setLongDescription(roviDescription.getDescription().orNull()); } Optional<String> longestDescription = getLongestDescription(localizedDescription); localizedDescription.setDescription(longestDescription.orNull()); }
Source:
<code><START> private void cleanUpOldUnusedTasksFromConnector(Collection<DatastreamTask> unusedTasks) { <END> unusedTasks.forEach(t -> deleteConnectorTask(t.getConnectorType(), t.getDatastreamTaskName())); }</code><technical_language>add logs for this starts this completes? Want able figure out long this process takes</technical_language>

Target:
private void cleanUpOldUnusedTasksFromConnector(Collection<DatastreamTask> unusedTasks) { LOG.info("cleanUpOldUnusedTasksFromConnector::start total unused tasks: {}", unusedTasks.size()); unusedTasks.forEach(t -> deleteConnectorTask(t.getConnectorType(), t.getDatastreamTaskName())); LOG.info("cleanUpOldUnusedTasksFromConnector::end"); }
Source:
<code><START> void testFilter() { <END> for (String region : supportedRegions) { SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegion(region)); assertNotNull(allResults); if (allResults.size() >= 1) { PlacementGroup group = allResults.last(); SortedSet<PlacementGroup> result = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("group-name", group.getName()).build())); assertNotNull(result); PlacementGroup compare = result.last(); assertEquals(compare, group); } } }</code><technical_language>[minor] public void, for tests</technical_language>

Target:
public void testFilter() { for (String region : supportedRegions) { SortedSet<PlacementGroup> allResults = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegion(region)); assertNotNull(allResults); if (allResults.size() >= 1) { PlacementGroup group = allResults.last(); SortedSet<PlacementGroup> result = newTreeSet(client.getPlacementGroupApi().get() .describePlacementGroupsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("group-name", group.getName()).build())); assertNotNull(result); PlacementGroup compare = result.last(); assertEquals(compare, group); } } }
Source:
<code>public ParseException(String message) { <START> super("Parse error in filter: " + message); <END> }</code><technical_language>Is this shown user? In case, want 'Error in filter'</technical_language>

Target:
public ParseException(String message) { super("Error in filter: " + message); }
Source:
<code>private SimplePrincipalCollection createPrincipalCollectionFromCertificate( X500Principal principal) { SimplePrincipalCollection principals = new SimplePrincipalCollection(); DefaultSecurityAssertionBuilder assertionBuilder = new DefaultSecurityAssertionBuilder(); AttributeStatement attributeStatement = new AttributeStatementDefault(); HashMap<String, Object> properties = createProperties(principal); for (ClaimsHandler claimsHandler : claimsHandlers) { ClaimsCollection claims = claimsHandler.retrieveClaims( new ClaimsParametersImpl(principal, Collections.singleton(principal), properties)); mergeClaimsToAttributes(attributeStatement, claims); } SecurityAssertion assertion = assertionBuilder .addAttributeStatement(attributeStatement) .addPrincipal(principal) .weight(SecurityAssertion.LOCAL_AUTH_WEIGHT) .issuer("DDF") .notBefore(new Date()) <START> .notOnOrAfter(new Date(new Date().getTime() + 14400000L)) <END> .build(); principals.add(assertion, "PKI"); return principals; }</code><technical_language>Instead of newing a Date instance gc'd immediately, instead create new Date line 101 for notBefore notOnOrAfter calls call System.currentTimeMillis() here, preference: java final Instant = Instant.now(); // ... .notBefore(Date.from(now)) .notOnOrfter(Date.from(now.plus(Duration.ofHours(4)))) //... This advantage of clear in intent need do math millis provided. improve throughput, Duration.ofHours(4) saved a const well</technical_language>

Target:
private SimplePrincipalCollection createPrincipalCollectionFromCertificate( X500Principal principal) { SimplePrincipalCollection principals = new SimplePrincipalCollection(); DefaultSecurityAssertionBuilder assertionBuilder = new DefaultSecurityAssertionBuilder(); AttributeStatement attributeStatement = new AttributeStatementDefault(); HashMap<String, Object> properties = createProperties(principal); for (ClaimsHandler claimsHandler : claimsHandlers) { ClaimsCollection claims = claimsHandler.retrieveClaims( new ClaimsParametersImpl(principal, Collections.singleton(principal), properties)); mergeClaimsToAttributes(attributeStatement, claims); } final Instant now = Instant.now(); SecurityAssertion assertion = assertionBuilder .addAttributeStatement(attributeStatement) .addPrincipal(principal) .weight(SecurityAssertion.LOCAL_AUTH_WEIGHT) .issuer("DDF") .notBefore(Date.from(now)) .notOnOrAfter(Date.from(now.plus(fourHours))) .build(); principals.add(assertion, "PKI"); return principals; }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FingerprintIdDetails that = (FingerprintIdDetails) o; <START> if (platformUnit != null ? !platformUnit.equals(that.platformUnit) : that.platformUnit != null) return false; <END> if (runBarcode != null ? !runBarcode.equals(that.runBarcode) : that.runBarcode != null) return false; if (runLane != null ? !runLane.equals(that.runLane) : that.runLane != null) return false; if (molecularBarcode != null ? !molecularBarcode.equals(that.molecularBarcode) : that.molecularBarcode != null) return false; if (library != null ? !library.equals(that.library) : that.library != null) return false; return sample != null ? sample.equals(that.sample) : that.sample == null; }</code><technical_language>this NPE if that.platformUnit is null</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; FingerprintIdDetails that = (FingerprintIdDetails) o; if (platformUnit != null ? !platformUnit.equals(that.platformUnit) : that.platformUnit != null) return false; if (runBarcode != null ? !runBarcode.equals(that.runBarcode) : that.runBarcode != null) return false; if (runLane != null ? !runLane.equals(that.runLane) : that.runLane != null) return false; if (molecularBarcode != null ? !molecularBarcode.equals(that.molecularBarcode) : that.molecularBarcode != null) return false; if (library != null ? !library.equals(that.library) : that.library != null) return false; if (file != null ? !file.equals(that.file) : that.file != null) return false; return sample != null ? sample.equals(that.sample) : that.sample == null; }
Source:
<code>public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); extensionHook.addOptionsParamSet(getCallbackParam()); extensionHook.addOptionsChangedListener(this); extensionHook.addSessionListener(this); if (View.isInitialised()) { extensionHook.getHookView().addStatusPanel( getCallbackPanel()); extensionHook.getHookView().addOptionPanel( getOptionsCallbackPanel()); <START> ExtensionHelp.enableHelpKey(getOptionsCallbackPanel(), "ui.tabs.callbacks"); <END> } }</code><technical_language>getCallbackPanel() instead</technical_language>

Target:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); extensionHook.addOptionsParamSet(getCallbackParam()); extensionHook.addOptionsChangedListener(this); extensionHook.addSessionListener(this); if (View.isInitialised()) { extensionHook.getHookView().addStatusPanel( getCallbackPanel()); extensionHook.getHookView().addOptionPanel( getOptionsCallbackPanel()); ExtensionHelp.enableHelpKey(getCallbackPanel(), "ui.tabs.callbacks"); } }
Source:
<code>public NeedsPaging<PatientIdentifier> doGetAll(Patient parent, RequestContext context) throws ResponseException { <START> return new NeedsPaging<PatientIdentifier>(parent.getActiveIdentifiers(), context.getIncludeAll()); <END> }</code><technical_language>Instead of patient.getActiveIdentifiers(), patient.getIdentifiers() if context.getIncludeAll() is true, return this list. Else build return a new list voided ones. this sense</technical_language>

Target:
public NeedsPaging<PatientIdentifier> doGetAll(Patient parent, RequestContext context) throws ResponseException { if (context.getIncludeAll()) { List<PatientIdentifier> newPatientIdentifier = new ArrayList<PatientIdentifier>(parent.getIdentifiers()); return new NeedsPaging<PatientIdentifier>(newPatientIdentifier, context); } else { return new NeedsPaging<PatientIdentifier>(parent.getActiveIdentifiers(), context); } }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommandImpl)) { return false; } final CommandImpl command = (CommandImpl)obj; <START> return Objects.equals(getName(), command.getName()) && <END> Objects.equals(getCommandLine(), command.getCommandLine()) && Objects.equals(getType(), command.getType()) && Objects.equals(getPreviewUrl(), command.getPreviewUrl()); }</code><technical_language>Previous version of equals pretty ok, add a new line of Objects.equals it, add getters here</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof CommandImpl)) { return false; } final CommandImpl command = (CommandImpl)obj; return Objects.equals(name, command.name) && Objects.equals(commandLine, command.commandLine) && Objects.equals(type, command.type) && Objects.equals(previewUrl, command.previewUrl); }
Source:
<code>public void testMergeAnomalyProperties() throws Exception { final long now = System.currentTimeMillis(); final long bucketSize = 300_000; final double parentVal = 1.0, childVal = 2.0; Map<String, String> parentProperties = new HashMap<>(); parentProperties.put("p1", "value1"); parentProperties.put("p2", "value2"); parentProperties.put("detectorComponentName", "rule1"); parentProperties.put("anomalyTimelinesView", generateAnomalyTimelineView(now, bucketSize, 10, parentVal).toJsonString()); Map<String, String> childProperties = new HashMap<>(); childProperties.put("p1", "value3"); childProperties.put("c1", "value4"); childProperties.put("detectorComponentName", "rule2"); childProperties.put("anomalyTimelinesView", generateAnomalyTimelineView(now + bucketSize, bucketSize, 10, childVal).toJsonString()); ThirdEyeUtils.mergeAnomalyProperties(parentProperties, childProperties); Assert.assertEquals(parentProperties.get("p1"), "value1"); Assert.assertEquals(parentProperties.get("p2"), "value2"); Assert.assertEquals(parentProperties.get("c1"), "value4"); Assert.assertEquals(parentProperties.get("detectorComponentName"), "rule1,rule2"); AnomalyTimelinesView merged = AnomalyTimelinesView.fromJsonString(parentProperties.get("anomalyTimelinesView")); Assert.assertEquals(merged.getTimeBuckets().size(), 11); <START> Assert.assertTrue(merged.getCurrentValues().get(0) - parentVal < 0.00001); Assert.assertTrue(merged.getCurrentValues().get(1) - parentVal < 0.00001); Assert.assertTrue(merged.getCurrentValues().get(10) - childVal < 0.00001); <END> }</code><technical_language>compare absolute difference: abs(actual - expected) < 0.00001. better: Assert.assertEquals(actual, expected, delta)</technical_language>

Target:
public void testMergeAnomalyProperties() { Map<String, String> parentProperties = new HashMap<>(); parentProperties.put("p1", "value1"); parentProperties.put("p2", "value2"); parentProperties.put("detectorComponentName", "rule1"); Map<String, String> childProperties = new HashMap<>(); childProperties.put("p1", "value3"); childProperties.put("c1", "value4"); childProperties.put("detectorComponentName", "rule2"); ThirdEyeUtils.mergeAnomalyProperties(parentProperties, childProperties); Assert.assertEquals(parentProperties.get("p1"), "value1"); Assert.assertEquals(parentProperties.get("p2"), "value2"); Assert.assertEquals(parentProperties.get("c1"), "value4"); Assert.assertEquals(parentProperties.get("detectorComponentName"), "rule1,rule2"); }
Source:
<code>public long getExpirationOffset(Pattern pattern) { long expiration = -1; int index = events.indexOf( pattern ); Interval[] intervals = matrix[index]; for (int i = 0; i < intervals.length; i++) { if (i != index) { expiration = Math.max( expiration, intervals[i].getUpperBound() ); if (expiration == Long.MAX_VALUE) { <START> return expiration; <END> } } } return expiration >= 0 ? expiration+1 : Long.MAX_VALUE; }</code><technical_language>IFF expiration infinite, simply return infinite ==</technical_language>

Target:
public long getExpirationOffset(Pattern pattern) { int index = events.indexOf( pattern ); Interval[] intervals = matrix[index]; long expiration = IntStream.range( 0, intervals.length ) .filter( i -> i != index ) .mapToLong( i -> intervals[i].getUpperBound() ) .max().orElse( NEVER_EXPIRES ); return expiration >= 0 && expiration != Long.MAX_VALUE ? expiration+1 : NEVER_EXPIRES; }
Source:
<code>public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } <START> SymbolicValue other = (SymbolicValue) obj; <END> return this.alwaysNullOrUndefined == other.alwaysNullOrUndefined && Objects.equals(this.truthiness, other.truthiness); }</code><technical_language>@pynicolas compare hash codes instead</technical_language>

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } SymbolicValue other = (SymbolicValue) obj; return this.definitelyNullOrUndefined == other.definitelyNullOrUndefined && Objects.equals(this.truthiness, other.truthiness); }
Source:
<code>private int getTotalNumOfOpenStatusSession(List<FeedbackSessionAttributes> allOpenFeedbackSessionsList) { <START> return (int) allOpenFeedbackSessionsList.stream() <END> .filter(sessionAttributes -> sessionAttributes.isOpened()) .count(); }</code><technical_language>change total... private variables type long avoid this awkward casting</technical_language>

Target:
private long getTotalNumOfOpenStatusSession(List<FeedbackSessionAttributes> allOpenFeedbackSessionsList) { return allOpenFeedbackSessionsList.stream() .filter(sessionAttributes -> sessionAttributes.isOpened()) .count(); }
Source:
<code>public void initialize() throws Exception { <START> System.err.println("initialize wait"); <END> Bundle bundle = FrameworkUtil.getBundle(AtsMethodDatabase.class); Assert.assertNotNull("Bundle cannot be null", bundle); int state = bundle.getState(); if (state != Bundle.STARTING || state != Bundle.ACTIVE) { bundle.start(); } System.err.println("Initializing ATS Database"); tempFolder = createTempFolder(); Assert.assertNotNull("TempFolder cannot be null", tempFolder); addResource(tempFolder, bundle, "data/hsql.zip"); addResource(tempFolder, bundle, "data/binary_data.zip"); checkExist(tempFolder, "hsql"); checkExist(tempFolder, "attr"); String dbPath = getDbHomePath(tempFolder, "hsql"); System.setProperty("osee.application.server.data", tempFolder.getAbsolutePath()); ConfigurationAdmin configAdmin = OsgiUtil.getConfigAdmin(); configuration = configAdmin.getConfiguration("org.eclipse.osee.jdbc.internal.osgi.JdbcComponentFactory", null); configuration.update(newConfig(dbPath)); jdbcService = OsgiUtil.getService(JdbcService.class, "(osgi.binding=orcs.jdbc.service)", 5000L); Assert.assertNotNull("Unable to get JdbcService", jdbcService); boolean isAlive = jdbcService.isServerAlive(10000L); Assert.assertEquals("database service is not alive", true, isAlive); }</code><technical_language>removed debugging code</technical_language>

Target:
public void initialize() throws Exception { Bundle bundle = FrameworkUtil.getBundle(AtsMethodDatabase.class); Assert.assertNotNull("Bundle cannot be null", bundle); int state = bundle.getState(); if (state != Bundle.STARTING || state != Bundle.ACTIVE) { bundle.start(); } System.err.println("Initializing ATS Database"); tempFolder = createTempFolder(); Assert.assertNotNull("TempFolder cannot be null", tempFolder); addResource(tempFolder, bundle, "data/hsql.zip"); addResource(tempFolder, bundle, "data/binary_data.zip"); checkExist(tempFolder, "hsql"); checkExist(tempFolder, "attr"); String dbPath = getDbHomePath(tempFolder, "hsql"); System.setProperty("osee.application.server.data", tempFolder.getAbsolutePath()); ConfigurationAdmin configAdmin = OsgiUtil.getConfigAdmin(); configuration = configAdmin.getConfiguration("org.eclipse.osee.jdbc.internal.osgi.JdbcComponentFactory", null); configuration.update(newConfig(dbPath)); jdbcService = OsgiUtil.getService(JdbcService.class, "(osgi.binding=orcs.jdbc.service)", 5000L); Assert.assertNotNull("Unable to get JdbcService", jdbcService); boolean isAlive = jdbcService.isServerAlive(10000L); Assert.assertEquals("database service is not alive", true, isAlive); }
Source:
<code>protected void addOriginalNameProp(Sheet.Set properties) { if (TextTranslationService.getInstance().hasProvider() && UserPreferences.displayTranslatedFileNames()) { properties.put(new NodeProperty<>( ORIG_NAME_PROP_NAME, ORIG_NAME_PROP_DISPLAY_NAME, "", <START> translatedName != null ? translatedName : "")); <END> if (translatedName == null) { new FileNameTransTask(originalName, this, new NameTranslationListener()).submit(); } } }</code><technical_language>This is wrong substitution if translatedName is null</technical_language>

Target:
protected void addOriginalNameProp(Sheet.Set properties) { if (TextTranslationService.getInstance().hasProvider() && UserPreferences.displayTranslatedFileNames()) { properties.put(new NodeProperty<>( ORIG_NAME_PROP_NAME, ORIG_NAME_PROP_DISPLAY_NAME, "", translatedName != null ? originalName : "")); if (translatedName == null) { new FileNameTransTask(originalName, this, new NameTranslationListener()).submit(); } } }
Source:
<code>public List<Project> getParentCandidates() throws OrmException, NoSuchProjectException { List<Project.NameKey> r = get(); List<Project> result = new ArrayList<Project>(r.size()); for (Project.NameKey k : r) { <START> result.add(projectControlFactory.controlFor(k).getProject()); <END> } return result; }</code><technical_language>Instead of performing candidate search in get() function above, do in this function avoid double control lookup for candidate. this method returns info needed return projects project.Namekeys, get() function call this instead of this calling get()</technical_language>

Target:
public List<Project> getParentCandidates() throws OrmException, NoSuchProjectException { Set<Project> result = new TreeSet<Project>(); for (Project.NameKey p : projectCache.all()) { try { final ProjectControl control = projectControlFactory.controlFor(p); final Project.NameKey parentK = control.getProject().getParent(); if (parentK != null) { ProjectControl pControl = projectControlFactory.controlFor(parentK); if (pControl.isVisible() || pControl.isOwner()) { result.add(pControl.getProject()); } } } catch (NoSuchProjectException e) { continue; } } result.add(projectControlFactory.controlFor(allProject).getProject()); return new ArrayList<Project>(result); }
Source:
<code>public Map<Long, Set<TObject>> chronologize(long record, String key, AccessToken creds, TransactionToken transaction) throws TException { <START> checkAccess(creds, transaction); <END> Map<Long, Set<TObject>> result = TLinkedHashMap.newTLinkedHashMap(); for (Long timestamp : audit(record, key, creds, transaction).keySet()) { Set<TObject> values = fetch(key, record, timestamp, creds, transaction); if (!values.isEmpty()) { result.put(timestamp, values); } } AtomicOperation operation = null; while (operation == null || !operation.commit()) { operation = updateChronologize(key, record, result, transaction != null ? transactions.get(transaction) : engine); } return result; }</code><technical_language>Here, add line: Compoundable store = transaction != null ? transactions.get(transaction) : engine</technical_language>

Target:
public Map<Long, Set<TObject>> chronologize(long record, String key, AccessToken creds, TransactionToken transaction) throws TException { checkAccess(creds, transaction); Compoundable store = transaction != null ? transactions.get(transaction): engine; Map<Long, Set<TObject>> result = TLinkedHashMap.newTLinkedHashMap(); for (Long timestamp : store.audit(key, record).keySet()) { Set<TObject> values = store.fetch(key, record, timestamp); if (!values.isEmpty()) { result.put(timestamp, values); } } AtomicOperation operation = null; while (operation == null || !operation.commit()) { operation = updateChronologizeResultSet(key, record, result, store); } return result; }
Source:
<code>ConfElement(StramElement element, ConfElement parent, Set<StramElement> additionalRelatedElements, Class<? extends Context> contextClass) { this.element = element; this.parent = parent; this.allRelatedElements.addAll(additionalRelatedElements); this.allRelatedElements.add(element); this.contextClass = contextClass; if (contextClass != null) { this.contextAttributes = ContextUtils.CONTEXT_CLASS_TO_ATTRIBUTES.get(contextClass); } else { this.contextAttributes = Sets.newHashSet(); <START> } <END> }</code><technical_language>ternary used? compact</technical_language>

Target:
ConfElement(StramElement element, ConfElement parent, Set<StramElement> additionalRelatedElements, Class<? extends Context> contextClass) { this.element = element; this.parent = parent; if (additionalRelatedElements != null) { this.allRelatedElements.addAll(additionalRelatedElements); } this.allRelatedElements.add(element); this.contextClass = contextClass; this.contextAttributes = contextClass != null ? ContextUtils.CONTEXT_CLASS_TO_ATTRIBUTES.get(contextClass) : new HashSet<String>(); }
Source:
<code>public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new CellInventoryHandler( new ItemCellInventory( o, container2 ), AEApi.instance().storage().getStorageChannel( IItemStorageChannel.class ) ); } <START> catch( final AppEngException e ) <END> { return null; } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') log rethrow this exception. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new ItemCellInventoryHandler( new ItemCellInventory( o, container2 ) ); } catch( final AppEngException e ) { return null; } }
Source:
<code>private String registerClient(String appID, String clientStartupID) { long error = new long [1]; long clientInfo = <START> OS.g_dbus_proxy_call_sync( <END> sessionManagerProxy, Converter.javaStringToCString("RegisterClient"), composeVariantTupleSS(appID, clientStartupID), OS.G_DBUS_CALL_FLAGS_NONE, dbusTimeoutMsec, 0, error); if (clientInfo == 0) return extractFreeGError(error[0]); clientObjectPath = extractVariantTupleS(clientInfo); OS.g_variant_unref(clientInfo); return null; }</code><technical_language>Synchronous necessary</technical_language>

Target:
private String registerClient(String appID, String clientStartupID) { long args = OS.g_variant_new( Converter.javaStringToCString("(ss)"), Converter.javaStringToCString(appID), Converter.javaStringToCString(clientStartupID)); long error = new long [1]; long clientInfo = OS.g_dbus_proxy_call_sync( sessionManagerProxy, Converter.javaStringToCString("RegisterClient"), args, OS.G_DBUS_CALL_FLAGS_NONE, dbusTimeoutMsec, 0, error); if (clientInfo == 0) return extractFreeGError(error[0]); clientObjectPath = extractVariantTupleS(clientInfo); OS.g_variant_unref(clientInfo); return null; }
Source:
<code>protected void determineMirror() { IBlockState current = getWorld().getBlockState(getPos()); IProperty<EnumRailDirection> shapeProp = ((BlockRailBase) current.getBlock()).getShapeProperty(); EnumRailDirection dir = current.getValue(shapeProp); boolean prevValue = isMirrored(); if (dir == EnumRailDirection.NORTH_SOUTH) { BlockPos offset = getPos(); if (TrackTools.isRailBlockAt(getWorld(), offset.west())) { offset = offset.west(); mirrored = true; } else { offset = offset.east(); mirrored = false; } if (TrackTools.isRailBlockAt(getWorld(), offset)) { IBlockState otherState = getWorld().getBlockState(getPos()); IProperty<EnumRailDirection> otherShapeProp = ((BlockRailBase) current.getBlock()).getShapeProperty(); <START> EnumRailDirection otherDir = current.getValue(shapeProp); <END> if (otherDir == EnumRailDirection.NORTH_SOUTH) getWorld().setBlockState(offset, otherState.withProperty(otherShapeProp, EnumRailDirection.EAST_WEST)); } } else if (dir == EnumRailDirection.EAST_WEST) mirrored = TrackTools.isRailBlockAt(getWorld(), getPos().north()); if (prevValue != isMirrored()) sendUpdateToClient(); }</code><technical_language>Helpers</technical_language>

Target:
protected void determineMirror() { EnumRailDirection dir = TrackTools.getTrackDirection(getWorld(), getPos()); boolean prevValue = isMirrored(); if (dir == EnumRailDirection.NORTH_SOUTH) { BlockPos offset = getPos(); if (TrackTools.isRailBlockAt(getWorld(), offset.west())) { offset = offset.west(); mirrored = true; } else { offset = offset.east(); mirrored = false; } if (TrackTools.isRailBlockAt(getWorld(), offset)) { EnumRailDirection otherDir = TrackTools.getTrackDirection(getWorld(), offset); if (otherDir == EnumRailDirection.NORTH_SOUTH) TrackTools.setTrackDirection(getWorld(), offset, EnumRailDirection.EAST_WEST); } } else if (dir == EnumRailDirection.EAST_WEST) mirrored = TrackTools.isRailBlockAt(getWorld(), getPos().north()); if (prevValue != isMirrored()) sendUpdateToClient(); }
Source:
<code>void validate(final DirCacheEntry[] cache, final int cCnt, int cIdx, final int pathOff) { if (entrySpan >= 0 && cIdx + entrySpan <= cCnt) { return; } entrySpan = 0; if (cCnt == 0) { return; } final byte[] firstPath = cache[cIdx].path; int stIdx = 0; while (cIdx < cCnt) { final byte[] currPath = cache[cIdx].path; if (pathOff > 0 && !peq(firstPath, currPath, pathOff)) { break; } final int cc; if (stIdx < childCnt) { cc = namecmp(currPath, pathOff, children[stIdx]); if (cc > 0) { removeChild(stIdx); continue; } } else { <START> cc = -1; <END> } final DirCacheTree st; if (cc < 0) { final int p = slash(currPath, pathOff); if (p < 0) { cIdx++; entrySpan++; continue; } st = new DirCacheTree(this, currPath, pathOff, p - pathOff); insertChild(stIdx, st); } else { st = children[stIdx]; } st.validate(cache, cCnt, cIdx, pathOff + st.nameLength() + 1); cIdx += st.entrySpan; entrySpan += st.entrySpan; stIdx++; } while (stIdx < childCnt) removeChild(childCnt - 1); }</code><technical_language>is cc = -1 in this case</technical_language>

Target:
void validate(final DirCacheEntry[] cache, final int cCnt, int cIdx, final int pathOff) { if (entrySpan >= 0 && cIdx + entrySpan <= cCnt) { return; } entrySpan = 0; if (cCnt == 0) { return; } final byte[] firstPath = cache[cIdx].path; int stIdx = 0; while (cIdx < cCnt) { final byte[] currPath = cache[cIdx].path; if (pathOff > 0 && !peq(firstPath, currPath, pathOff)) { break; } DirCacheTree st = stIdx < childCnt ? children[stIdx] : null; final int cc = namecmp(currPath, pathOff, st); if (cc > 0) { removeChild(stIdx); continue; } if (cc < 0) { final int p = slash(currPath, pathOff); if (p < 0) { cIdx++; entrySpan++; continue; } st = new DirCacheTree(this, currPath, pathOff, p - pathOff); insertChild(stIdx, st); } assert(st != null); st.validate(cache, cCnt, cIdx, pathOff + st.nameLength() + 1); cIdx += st.entrySpan; entrySpan += st.entrySpan; stIdx++; } while (stIdx < childCnt) removeChild(childCnt - 1); }
Source:
<code>public void restartFrom(RecordsRetrieved recordsRetrieved) { if (!(recordsRetrieved instanceof PrefetchRecordsRetrieved)) { throw new IllegalArgumentException( "Provided RecordsRetrieved was not produced by the PrefetchRecordsPublisher"); } PrefetchRecordsRetrieved prefetchRecordsRetrieved = (PrefetchRecordsRetrieved) recordsRetrieved; resetLock.writeLock().lock(); try { getRecordsResultQueue.clear(); log.debug("{} : Publisher thread takes over the draining control. Queue Size : {}, Demand : {}", shardId, getRecordsResultQueue.size(), requestedResponses.get()); <START> shouldDrainEventOnAck.set(false); <END> prefetchCounters.reset(); highestSequenceNumber = prefetchRecordsRetrieved.lastBatchSequenceNumber(); dataFetcher.resetIterator(prefetchRecordsRetrieved.shardIterator(), highestSequenceNumber, initialPositionInStreamExtended); wasReset = true; } finally { resetLock.writeLock().unlock(); } }</code><technical_language>this change, eventDeliveryLock semaphore released receiving ack. if ack is lost somewhere, shard stuck for ever. reason release restartFrom here? fixing issue in this change. adding this step Semaphore solution fix issue? do gain top of this new solution</technical_language>

Target:
public void restartFrom(RecordsRetrieved recordsRetrieved) { if (!(recordsRetrieved instanceof PrefetchRecordsRetrieved)) { throw new IllegalArgumentException( "Provided RecordsRetrieved was not produced by the PrefetchRecordsPublisher"); } PrefetchRecordsRetrieved prefetchRecordsRetrieved = (PrefetchRecordsRetrieved) recordsRetrieved; resetLock.writeLock().lock(); try { getRecordsResultQueue.clear(); log.debug("{} : Publisher thread takes over the draining control. Queue Size : {}, Demand : {}", shardId, getRecordsResultQueue.size(), requestedResponses.get()); shouldDrainEventOnlyOnAck.set(false); prefetchCounters.reset(); highestSequenceNumber = prefetchRecordsRetrieved.lastBatchSequenceNumber(); dataFetcher.resetIterator(prefetchRecordsRetrieved.shardIterator(), highestSequenceNumber, initialPositionInStreamExtended); wasReset = true; } finally { resetLock.writeLock().unlock(); } }
Source:
<code>public BulkActionValidation newValidationInstance() { try { return validationClass.getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { <START> throw new RuntimeException("Cannot create validation class of type " + validationClass.getName(), e); <END> } }</code><technical_language>NuxeoException</technical_language>

Target:
public BulkActionValidation newValidationInstance() { try { return validationClass.getDeclaredConstructor().newInstance(); } catch (ReflectiveOperationException e) { throw new NuxeoException("Cannot create validation class of type " + validationClass.getName(), e); } }
Source:
<code>public JoinHash get() { Optional<JoinFilterFunction> filterFunction = filterFunctionFactory.map(factory -> factory.create(session.toConnectorSession(), addresses, channels)); return new JoinHash( pagesHash, filterFunction, positionLinks.map(links -> { List<JoinFilterFunction> searchFunctions = <START> searchFunctionFactories.stream() <END> .map(factory -> factory.create(session.toConnectorSession(), addresses, channels)) .collect(ImmutableList.toImmutableList()); return links.create(searchFunctions); })); }</code><technical_language>nit: previous line</technical_language>

Target:
public JoinHash get() { Optional<JoinFilterFunction> filterFunction = filterFunctionFactory.map(factory -> factory.create(session.toConnectorSession(), addresses, channels)); return new JoinHash( pagesHash, filterFunction, positionLinks.map(links -> { List<JoinFilterFunction> searchFunctions = searchFunctionFactories.stream() .map(factory -> factory.create(session.toConnectorSession(), addresses, channels)) .collect(toImmutableList()); return links.create(searchFunctions); })); }
Source:
<code>public void testFullUrl() { Span span = new Span(); BinaryAnnotation ba = new BinaryAnnotation(); ba.setKey("http.url"); ba.setValue("http://localhost:8080/my/path"); span.setBinaryAnnotations(Arrays.asList(ba)); URL url = span.url(); assertNotNull(url); <START> assertEquals("/my/path", url.getPath()); <END> }</code><technical_language>create URL object set string representation annotation test equals span.url(). in next test. this good</technical_language>

Target:
public void testFullUrl() throws MalformedURLException { URL url = new URL("http://localhost:8080/my/path"); Span span = new Span(); BinaryAnnotation ba = new BinaryAnnotation(); ba.setKey("http.url"); ba.setValue(url.toString()); span.setBinaryAnnotations(Arrays.asList(ba)); URL result = span.url(); assertNotNull(result); assertEquals(url, result); }
Source:
<code>LogSegment(String name, File file, long capacityInBytes, StoreMetrics metrics) throws IOException { <START> if (!file.exists() || !file.isFile()) { <END> throw new IllegalArgumentException(file.getAbsolutePath() + " does not exist or is not a file"); } this.file = file; this.name = name; this.capacityInBytes = capacityInBytes; this.metrics = metrics; fileChannel = Utils.openChannel(file, true); segmentView = new Pair<>(file, fileChannel); state = State.FREE; endOffset = new AtomicLong(0); }</code><technical_language>if expect file available, planning pre-allocation? planning constructor allocation</technical_language>

Target:
LogSegment(String name, File file, long capacityInBytes, StoreMetrics metrics) throws IOException { if (!file.exists() || !file.isFile()) { throw new IllegalArgumentException(file.getAbsolutePath() + " does not exist or is not a file"); } this.file = file; this.name = name; this.capacityInBytes = capacityInBytes; this.metrics = metrics; fileChannel = Utils.openChannel(file, true); segmentView = new Pair<>(file, fileChannel); endOffset = new AtomicLong(0); }
Source:
<code><START> public void processPullReply(final K key, final V value) { <END> final PullFuture<V> future = pendingPulls.get(key); if (future != null) { future.setValue(value); } else { throw new RuntimeException(String.format("Pending pull was not found for key %s", key)); } }</code><technical_language>is change package local</technical_language>

Target:
void processPullReply(final K key, final V value) { final PullFuture<V> future = pendingPulls.get(key); if (future != null) { future.setValue(value); } else { throw new RuntimeException(String.format("Pending pull was not found for key %s", key)); } }
Source:
<code>public void removeContainerAgent(String containerId) { LOG.debug("Removing container agent {}", containerId); StreamingContainerAgent containerAgent = containers.remove(containerId); <START> if (containerHeartBeatMissSet.contains(containerId)) { <END> containerHeartBeatMissSet.remove(containerId); } if (containerAgent != null) { for (PTOperator oper : containerAgent.container.getOperators()) { StramEvent ev = new StramEvent.StopOperatorEvent(oper.getName(), oper.getId(), containerId); recordEventAsync(ev); } containerAgent.container.setFinishedTime(System.currentTimeMillis()); containerAgent.container.setState(PTContainer.State.KILLED); completedContainers.put(containerId, containerAgent.getContainerInfo()); } }</code><technical_language>is containerHeartBeatMissSet.contains() call necessary</technical_language>

Target:
public void removeContainerAgent(String containerId) { LOG.debug("Removing container agent {}", containerId); StreamingContainerAgent containerAgent = containers.remove(containerId); if (containerAgent != null) { for (PTOperator oper : containerAgent.container.getOperators()) { StramEvent ev = new StramEvent.StopOperatorEvent(oper.getName(), oper.getId(), containerId); recordEventAsync(ev); } containerAgent.container.setFinishedTime(System.currentTimeMillis()); containerAgent.container.setState(PTContainer.State.KILLED); completedContainers.put(containerId, containerAgent.getContainerInfo()); } }
Source:
<code>public boolean deserializeZxidDigest(InputArchive ia, long startZxidOfSnapshot) throws IOException { if (!DigestCalculator.digestEnabled()) { return false; } try { ZxidDigest zxidDigest = new ZxidDigest(); zxidDigest.deserialize(ia); if (zxidDigest.zxid > 0) { digestFromLoadedSnapshot = zxidDigest; <START> LOG.info("The digest in the snapshot is {}, 0x{}, {}", <END> digestFromLoadedSnapshot.digestVersion, Long.toHexString(digestFromLoadedSnapshot.zxid), digestFromLoadedSnapshot.digest); } else { digestFromLoadedSnapshot = null; LOG.info("The digest value is empty in snapshot"); } if (digestFromLoadedSnapshot != null && digestFromLoadedSnapshot.zxid < startZxidOfSnapshot) { LOG.info("The zxid of snapshot digest 0x{} is smaller " + "than the known snapshot highest zxid, the snapshot " + "started with zxid 0x{}. It will be invalid to use " + "this snapshot digest associated with this zxid, will " + "ignore comparing it.", Long.toHexString(digestFromLoadedSnapshot.zxid), Long.toHexString(startZxidOfSnapshot)); digestFromLoadedSnapshot = null; } return true; } catch (EOFException e) { LOG.warn("Got EOF exception while reading the digest, " + "likely due to the reading an older snapshot."); return false; } }</code><technical_language>provide more description here? example: digest in snapshot a digest version of {}, zxid {}, digest {}</technical_language>

Target:
public boolean deserializeZxidDigest(InputArchive ia, long startZxidOfSnapshot) throws IOException { if (!ZooKeeperServer.isDigestEnabled()) { return false; } try { ZxidDigest zxidDigest = new ZxidDigest(); zxidDigest.deserialize(ia); if (zxidDigest.zxid > 0) { digestFromLoadedSnapshot = zxidDigest; LOG.info("The digest in the snapshot has digest version of {}, " + ", with zxid as 0x{}, and digest value as {}", digestFromLoadedSnapshot.digestVersion, Long.toHexString(digestFromLoadedSnapshot.zxid), digestFromLoadedSnapshot.digest); } else { digestFromLoadedSnapshot = null; LOG.info("The digest value is empty in snapshot"); } if (digestFromLoadedSnapshot != null && digestFromLoadedSnapshot.zxid < startZxidOfSnapshot) { LOG.info("The zxid of snapshot digest 0x{} is smaller " + "than the known snapshot highest zxid, the snapshot " + "started with zxid 0x{}. It will be invalid to use " + "this snapshot digest associated with this zxid, will " + "ignore comparing it.", Long.toHexString(digestFromLoadedSnapshot.zxid), Long.toHexString(startZxidOfSnapshot)); digestFromLoadedSnapshot = null; } return true; } catch (EOFException e) { LOG.warn("Got EOF exception while reading the digest, likely due to the reading an older snapshot."); return false; } }
Source:
<code>private Collection<CommandParameter> getDiagramTypesCreation() { final Collection<CommandParameter> result = new HashSet<CommandParameter>(); for (final IDiagramTypeDescriptor diagramTypeDescriptor : DiagramTypeDescriptorRegistry.getInstance().getAllDiagramTypeDescriptors()) { DiagramDescription specificDiagramDescription = diagramTypeDescriptor.getDiagramDescriptionProvider().createDiagramDescription(); if (specificDiagramDescription.getDefaultLayer() == null) { specificDiagramDescription.setDefaultLayer(DescriptionFactory.eINSTANCE.createLayer()); <START> } <END> final CommandParameter typeCommandParameter = new CommandParameter(null, DescriptionPackage.Literals.VIEWPOINT__OWNED_REPRESENTATIONS, specificDiagramDescription); result.add(typeCommandParameter); } return result; }</code><technical_language>configure layer name in factory. org.eclipse.sirius.diagram.description.impl.DescriptionFactoryImpl.createLayer()</technical_language>

Target:
private Collection<CommandParameter> getDiagramTypesCreation() { final Collection<CommandParameter> result = new HashSet<CommandParameter>(); for (final IDiagramTypeDescriptor diagramTypeDescriptor : DiagramTypeDescriptorRegistry.getInstance().getAllDiagramTypeDescriptors()) { DiagramDescription specificDiagramDescription = diagramTypeDescriptor.getDiagramDescriptionProvider().createDiagramDescription(); if (specificDiagramDescription.getDefaultLayer() == null) { Layer layer = DescriptionFactory.eINSTANCE.createLayer(); layer.setName("Default"); specificDiagramDescription.setDefaultLayer(layer); } final CommandParameter typeCommandParameter = new CommandParameter(null, DescriptionPackage.Literals.VIEWPOINT__OWNED_REPRESENTATIONS, specificDiagramDescription); result.add(typeCommandParameter); } return result; }
Source:
<code><START> public void onFetched(FlurryAdInterstitial adInterstitial) { <END> Log.d(LOG_TAG, "onFetched(" + adInterstitial.toString() + ")"); if (mListener != null) { mListener.onInterstitialLoaded(); } }</code><technical_language>I hope adInterstitial is NonNull. silly crash a null pointer exception adInterstitial.toString() null pointed. better, toString() print "null" if null</technical_language>

Target:
public void onFetched(FlurryAdInterstitial adInterstitial) { Log.d(LOG_TAG, "onFetched: Flurry interstitial ad fetched successfully!"); if (mListener != null) { mListener.onInterstitialLoaded(); } }
Source:
<code>public void onMinecartPass(EntityMinecart cart) { <START> if (!isPowered() && !theWorldAsserted().getBlockState(getPos().down()).getBlock().isVisuallyOpaque()) { <END> if (cart.isBeingRidden()) { CartTools.removePassengers(cart, cart.getPositionVector().addVector(0, -2, 0)); } cart.getEntityData().setInteger("MountPrevention", TIME_TILL_NEXT_MOUNT); } }</code><technical_language>suggest block this well, drops entity blocks down</technical_language>

Target:
public void onMinecartPass(EntityMinecart cart) { if (isPowered()) return; World world = theWorldAsserted(); BlockPos.PooledMutableBlockPos pos = BlockPos.PooledMutableBlockPos.retain().setPos(getTile().getPos()); for (int i = 0; i < 2; i++) { pos.move(EnumFacing.DOWN); if (world.getBlockState(pos).getBlock().isVisuallyOpaque()) return; } if (cart.isBeingRidden()) { CartTools.removePassengers(cart, cart.getPositionVector().addVector(0, -2, 0)); } cart.getEntityData().setInteger("MountPrevention", TIME_TILL_NEXT_MOUNT); }
Source:
<code>public ResponseEntity<List<VocabularyDTO>> suggestLicenses(@RequestParam("userId") Long userId) { ENDING licenses are added -> do not need to suggest final List<VocabularyDTO> vocabularies = vocabularyConversionService.getUnavailableVocabularies(userId, true); <START> return ResponseEntity.ok(vocabularies); <END> }</code><technical_language>entity</technical_language>

Target:
public List<VocabularyDTO> suggestLicenses(@RequestParam("userId") Long userId) { ENDING licenses are added -> do not need to suggest final List<VocabularyDTO> vocabularies = vocabularyConversionService.getUnavailableVocabularies(userId, true); return vocabularies; }
Source:
<code>public void forceGroupStructureSynchronization(PerunSession sess, Group group) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupStructureSynchronizationAlreadyRunningException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, group); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "synchronizeGroupStructure"); } getGroupsManagerBl().forceGroupStructureSynchronization(sess, group); <START> } <END></code><technical_language>Bad indentation for this method</technical_language>

Target:
public void forceGroupStructureSynchronization(PerunSession sess, Group group) throws InternalErrorException, GroupNotExistsException, PrivilegeException, GroupStructureSynchronizationAlreadyRunningException { Utils.checkPerunSession(sess); getGroupsManagerBl().checkGroupExists(sess, group); if (!AuthzResolver.isAuthorized(sess, Role.VOADMIN, group) && !AuthzResolver.isAuthorized(sess, Role.GROUPADMIN, group)) { throw new PrivilegeException(sess, "forceGroupStructureSynchronization"); } getGroupsManagerBl().forceGroupStructureSynchronization(sess, group); }
Source:
<code>public static String decrypt(final byte[] key, final String content) throws Exception { final byte[] decodedContent = new Base64().decode(URLDecoder.decode(content, ASCII.displayName())); final byte[] iv = extractIV(decodedContent); final byte[] decrypted = new CryptoBox(key).decrypt(iv, extractContent(decodedContent)); <START> return new String(decrypted, ASCII); <END> }</code><technical_language>is tests for encrypt/decrypt methods of this util</technical_language>

Target:
public static String decrypt(final byte[] key, final String content) throws Exception { final byte[] decodedContent = UrlBase64.decode(URLDecoder.decode(content, ASCII.displayName())); final byte[] iv = extractIV(decodedContent); final byte[] decrypted = new CryptoBox(key).decrypt(iv, extractContent(decodedContent)); return new String(decrypted, ASCII); }
Source:
<code>public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { if (!currentUser.getCapabilities().canCreateProject()) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } parseCommandLine(); if (!suggestParent) { <START> if (projectName == null) { <END> throw new Failure(1, "fatal: Option \"--name (-n)\" is required"); } try { final CreateProjectArgs args = new CreateProjectArgs(); args.setProjectName(projectName); args.setOwnerIds(ownerIds); args.setNewParent(newParent); args.setPermissionsOnly(permissionsOnly); args.setProjectDescription(projectDescription); args.setSubmitType(submitType); args.setContributorAgreements(contributorAgreements); args.setSignedOffBy(signedOffBy); args.setContentMerge(contentMerge); args.setChangeIdRequired(requireChangeID); args.setBranch(branch); args.setCreateEmptyCommit(createEmptyCommit); final CreateProject createProject = CreateProjectFactory.create(args); createProject.createProject(); } catch (ProjectCreationFailedException err) { throw new UnloggedFailure(1, "fatal: " + err.getMessage(), err); } } else { List<Project> parentCandidates = retrieveParentCandidatesFactory.create().getParentCandidates(); PrintWriter p = toPrintWriter(out); for (Project parent : parentCandidates) { p.print(parent.getNameKey() + "\n"); } p.flush(); } } }); }</code><technical_language>if I adding this check is related feature is implemented this change</technical_language>

Target:
public void start(final Environment env) { startThread(new CommandRunnable() { @Override public void run() throws Exception { if (!currentUser.getCapabilities().canCreateProject()) { String msg = String.format( "fatal: %s does not have \"Create Project\" capability.", currentUser.getUserName()); throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } PrintWriter p = toPrintWriter(out); parseCommandLine(); try { if (!suggestParent) { if (projectName == null) { throw new UnloggedFailure(1, "Error: Project name is required."); } final CreateProjectArgs args = new CreateProjectArgs(); args.setProjectName(projectName); args.ownerIds = ownerIds; args.newParent = newParent; args.permissionsOnly = permissionsOnly; args.projectDescription = projectDescription; args.submitType = submitType; args.contributorAgreements = contributorAgreements; args.signedOffBy = signedOffBy; args.contentMerge = contentMerge; args.changeIdRequired = requireChangeID; args.branch = branch; args.createEmptyCommit = createEmptyCommit; final CreateProject createProject = CreateProjectFactory.create(args); createProject.createProject(); } else { List<Project.NameKey> parentCandidates = retrieveParentCandidatesFactory.create().get(); for (Project.NameKey parent : parentCandidates) { p.print(parent + "\n"); } } } catch (ProjectCreationFailedException err) { throw new UnloggedFailure(1, "Fatal: " + err.getMessage(), err); } finally { p.flush(); } } }); }