auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Matcher<View> atPositionOnView(final int position, final int targetViewId) { return new TypeSafeMatcher<View>() { Resources resources = null; View childView; public void describeTo(Description description) { String idDescription = Integer.toString(recyclerViewId); if (this.resources != null) { try { idDescription = this.resources.getResourceName(recyclerViewId); <START> } catch (Resources.NotFoundException var4) { <END> idDescription = String.format("%s (resource name not found)", recyclerViewId); } } description.appendText("with id: " + idDescription); } public boolean matchesSafely(View view) { this.resources = view.getResources(); if (childView == null) { RecyclerView recyclerView = (RecyclerView) view.getRootView().findViewById(recyclerViewId); if (recyclerView != null && recyclerView.getId() == recyclerViewId) { childView = recyclerView.findViewHolderForAdapterPosition(position).itemView; } else { return false; } } if (targetViewId == -1) { return view == childView; } else { View targetView = childView.findViewById(targetViewId); return view == targetView; } } }; }</code><technical_language>var4? Resources.NotFoundException e a bit nicer.</technical_language>

Target:
public Matcher<View> atPositionOnView(final int position, final int targetViewId) { return new TypeSafeMatcher<View>() { Resources resources = null; View childView; public void describeTo(Description description) { String idDescription = Integer.toString(recyclerViewId); if (this.resources != null) { try { idDescription = this.resources.getResourceName(recyclerViewId); } catch (Resources.NotFoundException ignored) { idDescription = String.format("%s (resource name not found)", recyclerViewId); } } description.appendText("with id: " + idDescription); } public boolean matchesSafely(View view) { this.resources = view.getResources(); if (childView == null) { RecyclerView recyclerView = (RecyclerView) view.getRootView().findViewById(recyclerViewId); if (recyclerView != null && recyclerView.getId() == recyclerViewId) { childView = recyclerView.findViewHolderForAdapterPosition(position).itemView; } else { return false; } } if (targetViewId == -1) { return view == childView; } else { View targetView = childView.findViewById(targetViewId); return view == targetView; } } }; }
Source:
<code>public I setContext(HttpRequest request) { <START> this.request = GeneratedHttpRequest.class.cast(request); <END> return (I) this; }</code><technical_language>Check for illegal arg happy a ClassCastException here</technical_language>

Target:
public I setContext(HttpRequest request) { checkArgument(request instanceof GeneratedHttpRequest, "ArgsToPagedIterable only supports a GeneratedHttpRequest"); this.request = GeneratedHttpRequest.class.cast(request); return (I) this; }
Source:
<code>private <T extends Enum<T>> void registerStatistic(String statNameSuffix, StatisticType type, final OperationStatisticDescriptor<T> descriptor, final EnumSet<T> outcomes) { if (contextObject == null) { return; } Set<TreeNode> result = queryBuilder() .descendants() .filter(context(attributes(Matchers.<Map<String, Object>>allOf( hasAttribute("type", descriptor.getType()), hasAttribute("name", descriptor.getObserverName()), <START> hasAttribute("tags", new Matcher<Set<String>>() { <END> @Override protected boolean matchesSafely(Set<String> object) { return object.containsAll(descriptor.getTags()); } }))))) .filter(context(identifier(subclassOf(OperationStatistic.class)))) .build().execute(Collections.singleton(ContextManager.nodeFor(contextObject))); if (!result.isEmpty()) { for (TreeNode node : result) { String discriminator = null; Map<String, Object> properties = (Map<String, Object>) node.getContext().attributes().get("properties"); if (properties != null && properties.containsKey("discriminator")) { discriminator = properties.get("discriminator").toString(); } String fullStatName = (discriminator == null ? "" : (discriminator + ":")) + statNameSuffix; final OperationStatistic<T> statistic = (OperationStatistic<T>) node.getContext().attributes().get("this"); registerStatistic(fullStatName, type, new ValueStatistic<Number>() { @Override public Number value() { return statistic.sum(outcomes); } }); } } }</code><technical_language>Mutualize other matcher tags</technical_language>

Target:
private <T extends Enum<T>> void registerStatistic(String statNameSuffix, StatisticType type, final OperationStatisticDescriptor<T> descriptor, final EnumSet<T> outcomes) { if (contextObject == null) { return; } Set<TreeNode> result = queryBuilder() .descendants() .filter(context(attributes(Matchers.<Map<String, Object>>allOf( hasAttribute("type", descriptor.getType()), hasAttribute("name", descriptor.getObserverName()), hasTags(descriptor.getTags()))))) .filter(context(identifier(subclassOf(OperationStatistic.class)))) .build().execute(Collections.singleton(ContextManager.nodeFor(contextObject))); if (!result.isEmpty()) { for (TreeNode node : result) { String discriminator = null; Map<String, Object> properties = (Map<String, Object>) node.getContext().attributes().get("properties"); if (properties != null && properties.containsKey("discriminator")) { discriminator = properties.get("discriminator").toString(); } String fullStatName = (discriminator == null ? "" : (discriminator + ":")) + statNameSuffix; final OperationStatistic<T> statistic = (OperationStatistic<T>) node.getContext().attributes().get("this"); registerStatistic(fullStatName, type, new ValueStatistic<Number>() { @Override public Number value() { return statistic.sum(outcomes); } }); } } }
Source:
<code>private void setPublicURIs(final FileSystem fileSystem) { final String[] uris = fileSystem.toString().split("\\r?\\n"); final List<PublicURI> publicURIs = new ArrayList<>(uris.length); for (final String s : uris) { <START> final int protocolStart = s.indexOf("://"); <END> publicURIs.add(getPublicURI(s, protocolStart)); } repo.setPublicURIs(publicURIs); }</code><technical_language>a constant for "://"</technical_language>

Target:
private void setPublicURIs(final FileSystem fileSystem) { final String[] uris = fileSystem.toString().split("\\r?\\n"); final List<PublicURI> publicURIs = new ArrayList<>(uris.length); for (final String s : uris) { final int protocolStart = s.indexOf(PROTOCOL_SEPARATOR); publicURIs.add(getPublicURI(s, protocolStart)); } repo.setPublicURIs(publicURIs); }
Source:
<code>private void handleRelatedAlarms(OnmsAlarm situation) { if (!situation.isSituation()) { return; } alarmAssociationById.putIfAbsent(situation.getId(), new HashMap<>()); final Map<Integer, AlarmAssociationAndFact> associationFacts = alarmAssociationById.get(situation.getId()); for (AlarmAssociation association : situation.getAssociatedAlarms()) { Integer alarmId = association.getRelatedAlarm().getId(); AlarmAssociationAndFact assocationFact = associationFacts.get(alarmId); if (assocationFact == null) { LOG.debug("Inserting alarm association into session: {}", association); final FactHandle fact = getKieSession().insert(association); associationFacts.put(alarmId, new AlarmAssociationAndFact(association, fact)); } else { FactHandle fact = assocationFact.getFact(); LOG.trace("Updating alarm assocation in session: {}", assocationFact); getKieSession().update(fact, association); associationFacts.put(alarmId, new AlarmAssociationAndFact(association, fact)); } } Set<Integer> deletedAlarmIds = associationFacts.values().stream() .map(fact -> fact.getAlarmAssociation().getRelatedAlarm().getId()) .filter(alarmId -> !situation.getRelatedAlarmIds().contains(alarmId)) .collect(Collectors.toSet()); <START> deletedAlarmIds.stream().forEach(alarmId -> { <END> final AlarmAssociationAndFact associationAndFact = associationFacts.remove(alarmId); if (associationAndFact != null) { LOG.debug("Deleting AlarmAssociationAndFact from session: {}", associationAndFact.getAlarmAssociation()); getKieSession().delete(associationAndFact.getFact()); } }); }</code><technical_language>suggestion deletedAlarmIds.forEach(alarmId -> {</technical_language>

Target:
private void handleRelatedAlarms(OnmsAlarm situation) { if (!situation.isSituation()) { return; } alarmAssociationById.putIfAbsent(situation.getId(), new HashMap<>()); final Map<Integer, AlarmAssociationAndFact> associationFacts = alarmAssociationById.get(situation.getId()); for (AlarmAssociation association : situation.getAssociatedAlarms()) { Integer alarmId = association.getRelatedAlarm().getId(); AlarmAssociationAndFact assocationFact = associationFacts.get(alarmId); if (assocationFact == null) { LOG.debug("Inserting alarm association into session: {}", association); final FactHandle fact = getKieSession().insert(association); associationFacts.put(alarmId, new AlarmAssociationAndFact(association, fact)); } else { FactHandle fact = assocationFact.getFact(); LOG.trace("Updating alarm assocation in session: {}", assocationFact); getKieSession().update(fact, association); associationFacts.put(alarmId, new AlarmAssociationAndFact(association, fact)); } } Set<Integer> deletedAlarmIds = associationFacts.values().stream() .map(fact -> fact.getAlarmAssociation().getRelatedAlarm().getId()) .filter(alarmId -> !situation.getRelatedAlarmIds().contains(alarmId)) .collect(Collectors.toSet()); deletedAlarmIds.forEach(alarmId -> { final AlarmAssociationAndFact associationAndFact = associationFacts.remove(alarmId); if (associationAndFact != null) { LOG.debug("Deleting AlarmAssociationAndFact from session: {}", associationAndFact.getAlarmAssociation()); getKieSession().delete(associationAndFact.getFact()); } }); }
Source:
<code>public Obs saveObs(Obs obs, String changeMessage) throws APIException { if(obs == null){ throw new APIException("Obs.error.cannot.be.null", (Object[]) null); } if(obs.getId() != null && changeMessage == null){ throw new APIException("Obs.error.ChangeMessage.required", (Object[]) null); } handleExistingObsWithComplexConcept(obs); ensureRequirePrivilege(obs); if (obs.getObsId() == null || obs.getVoided()) { return saveNewOrVoidedObs(obs,changeMessage); } else if(!obs.isDirty()){ setPersonFromEncounter(obs); return saveObsNotDirty(obs, changeMessage); } else { Errors errors = new BindException(obs, "obs"); <START> new ObsValidator().validate(obs, errors); <END> if (!errors.hasFieldErrors("person")){ setPersonFromEncounter(obs); return saveExistingObs(obs,changeMessage); } else{ throw new APIException("Obs.error.PersonId.mismatch", (Object[]) null); } } }</code><technical_language>need call validator, called automatically AOP advice saveObs method</technical_language>

Target:
public Obs saveObs(Obs obs, String changeMessage) throws APIException { if(obs == null){ throw new APIException("Obs.error.cannot.be.null", (Object[]) null); } if(obs.getId() != null && changeMessage == null){ throw new APIException("Obs.error.ChangeMessage.required", (Object[]) null); } handleExistingObsWithComplexConcept(obs); ensureRequirePrivilege(obs); if (obs.getObsId() == null || obs.getVoided()) { return saveNewOrVoidedObs(obs,changeMessage); } else if(!obs.isDirty()){ setPersonFromEncounter(obs); return saveObsNotDirty(obs, changeMessage); } else { setPersonFromEncounter(obs); return saveExistingObs(obs,changeMessage); } }
Source:
<code>protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getQos().setIsChangable(!externalNetwork); getAddQosCommand().setIsExecutionAllowed(!externalNetwork); String label = getNetworkLabel().getSelectedItem(); <START> if (externalNetwork) { <END> getNetworkLabel().setItems(new HashSet<String>()); } else { getNetworkLabel().setItems(dcLabels); } getNetworkLabel().setSelectedItem(label); }</code><technical_language>consider 'ternary if'</technical_language>

Target:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getQos().setIsChangable(!externalNetwork); getAddQosCommand().setIsExecutionAllowed(!externalNetwork); String label = getNetworkLabel().getSelectedItem(); getNetworkLabel().setItems(externalNetwork ? new HashSet<String>() : dcLabels); getNetworkLabel().setSelectedItem(label); }
Source:
<code>protected void executeCommand() { setVds(null); if (getVds() == null) { setCommandShouldBeLogged(false); <START> log.infoFormat("SSH powerdown will not be executed on host {0}({1}) since it doesn't exist anymore.", <END> getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } if (getVds().getStatus() != VDSStatus.Maintenance) { setCommandShouldBeLogged(false); log.infoFormat("SSH powerdown will not be executed on host {0}({1}) since it is not in Maintenance.", getVdsName(), getVdsId()); getReturnValue().setSucceeded(false); return; } boolean result = executeSshPowerdown(getVds().getVdsGroupCompatibilityVersion().toString()); if (result) { getVds().setStatus(VDSStatus.Down); if (!getParameters().getKeepPolicyPMEnabled()) { getVds().setPowerManagementControlledByPolicy(false); } getDbFacade().getVdsDynamicDao().update(getVds().getDynamicData()); } else if (getParameters().getFallbackToPowerManagement() && getVds().getpm_enabled()) { FenceVdsActionParameters parameters = new FenceVdsActionParameters(getVds().getId(), FenceActionType.Stop); parameters.setKeepPolicyPMEnabled(getParameters().getKeepPolicyPMEnabled()); Backend.getInstance().runInternalAction(VdcActionType.StopVds, parameters, ExecutionHandler.createInternalJobContext()); } getReturnValue().setSucceeded(result); }</code><technical_language>power</technical_language>

Target:
protected void executeCommand() { setVds(null); if (getVds() == null) { handleError("SSH power down will not be executed on host {0} ({1}) since it doesn't exist anymore."); return; } if (getVds().getStatus() != VDSStatus.Maintenance) { handleError("SSH power down will not be executed on host {0} ({1}) since it is not in Maintenance."); return; } boolean result = executeSshPowerdown(getVds().getVdsGroupCompatibilityVersion().toString()); if (result) { getVds().setStatus(VDSStatus.Down); if (!getParameters().getKeepPolicyPMEnabled()) { getVds().setPowerManagementControlledByPolicy(false); } getDbFacade().getVdsDynamicDao().update(getVds().getDynamicData()); } else if (getParameters().getFallbackToPowerManagement() && getVds().getpm_enabled()) { FenceVdsActionParameters parameters = new FenceVdsActionParameters(getVds().getId(), FenceActionType.Stop); parameters.setKeepPolicyPMEnabled(getParameters().getKeepPolicyPMEnabled()); Backend.getInstance().runInternalAction(VdcActionType.StopVds, parameters, ExecutionHandler.createInternalJobContext()); } getReturnValue().setSucceeded(result); }
Source:
<code>public Optional<Symbol> resolveMember(String memberName) { if (types.stream().anyMatch(type -> type instanceof RuntimeType && ((RuntimeType) type).hasUnresolvedHierarchy())) { return Optional.empty(); } Set<Optional<Symbol>> resolved = types.stream() .map(t -> t.resolveMember(memberName)) .filter(Optional::isPresent) .collect(Collectors.toSet()); if (resolved.isEmpty()) { return Optional.empty(); } else if (resolved.size() == 1) { return resolved.iterator().next(); } <START> return Optional.of(AmbiguousSymbolImpl.create(resolved.stream().map(s -> s.orElse(null)).filter(Objects::nonNull).collect(Collectors.toSet()))); <END> }</code><technical_language>I "resolveMember" create a new symbol. find another approach</technical_language>

Target:
public Optional<Symbol> resolveMember(String memberName) { if (types.stream().anyMatch(type -> type instanceof RuntimeType && ((RuntimeType) type).hasUnresolvedHierarchy())) { return Optional.empty(); } Set<Optional<Symbol>> resolved = types.stream() .map(t -> t.resolveMember(memberName)) .filter(Optional::isPresent) .collect(Collectors.toSet()); return resolved.size() == 1 ? resolved.iterator().next() : Optional.empty(); }
Source:
<code>public static BlobProperties buildBlobProperties(Map<String, Object> args) throws RestServiceException { Account account = (Account) args.get(InternalKeys.TARGET_ACCOUNT_KEY); if (account == null) { <START> throw new RestServiceException(InternalKeys.TARGET_ACCOUNT_KEY + " is not set", RestServiceErrorCode.MissingArgs); <END> } Container container = (Container) args.get(InternalKeys.TARGET_CONTAINER_KEY); if (container == null) { throw new RestServiceException(InternalKeys.TARGET_CONTAINER_KEY + " is not set", RestServiceErrorCode.MissingArgs); } String serviceId = getHeader(args, Headers.SERVICE_ID, true); String contentType = getHeader(args, Headers.AMBRY_CONTENT_TYPE, true); String ownerId = getHeader(args, Headers.OWNER_ID, false); long ttl = Utils.Infinite_Time; String ttlStr = getHeader(args, Headers.TTL, false); if (ttlStr != null) { try { ttl = Long.parseLong(ttlStr); if (ttl < -1) { throw new RestServiceException(Headers.TTL + "[" + ttl + "] is not valid (has to be >= -1)", RestServiceErrorCode.InvalidArgs); } } catch (NumberFormatException e) { throw new RestServiceException(Headers.TTL + "[" + ttlStr + "] could not parsed into a number", RestServiceErrorCode.InvalidArgs); } } return new BlobProperties(-1, serviceId, ownerId, contentType, isPrivate(args), ttl, account.getId(), container.getId()); }</code><technical_language>this InternalServerError</technical_language>

Target:
public static BlobProperties buildBlobProperties(Map<String, Object> args) throws RestServiceException { Account account = (Account) args.get(InternalKeys.TARGET_ACCOUNT_KEY); if (account == null) { throw new RestServiceException(InternalKeys.TARGET_ACCOUNT_KEY + " is not set", RestServiceErrorCode.InternalServerError); } Container container = (Container) args.get(InternalKeys.TARGET_CONTAINER_KEY); if (container == null) { throw new RestServiceException(InternalKeys.TARGET_CONTAINER_KEY + " is not set", RestServiceErrorCode.InternalServerError); } String serviceId = getHeader(args, Headers.SERVICE_ID, true); String contentType = getHeader(args, Headers.AMBRY_CONTENT_TYPE, true); String ownerId = getHeader(args, Headers.OWNER_ID, false); long ttl = Utils.Infinite_Time; String ttlStr = getHeader(args, Headers.TTL, false); if (ttlStr != null) { try { ttl = Long.parseLong(ttlStr); if (ttl < -1) { throw new RestServiceException(Headers.TTL + "[" + ttl + "] is not valid (has to be >= -1)", RestServiceErrorCode.InvalidArgs); } } catch (NumberFormatException e) { throw new RestServiceException(Headers.TTL + "[" + ttlStr + "] could not parsed into a number", RestServiceErrorCode.InvalidArgs); } } return new BlobProperties(-1, serviceId, ownerId, contentType, isPrivate(args), ttl, account.getId(), container.getId()); }
Source:
<code>public AlphaRejectBlocksNode(Context context) { Config config = context.get(Config.class); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); worldRenderer = context.get(WorldRenderer.class); renderQueues = context.get(RenderQueuesHelper.class); wireframeStateChange = new SetWireframe(true); <START> RenderingDebugConfig renderingDebugConfig = config.getRendering().getDebug(); <END> new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }</code><technical_language>1. other reasons rewrite this context.get(Config.class).getRendering().getDebug(); avoid storing config. 2. check if chance RenderingConfig class is straight context</technical_language>

Target:
public AlphaRejectBlocksNode(Context context) { renderQueues = context.get(RenderQueuesHelper.class); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); worldRenderer = context.get(WorldRenderer.class); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); addDesiredStateChange(new EnableMaterial(CHUNK_MATERIAL)); chunkMaterial = getMaterial(CHUNK_MATERIAL); }
Source:
<code>public static String print(Node n, String encoding) { if (n == null) { return null; } try { Document document = null; if (n instanceof Document) { document = (Document) n; } else { document = n.getOwnerDocument(); } StringWriter stringOut = new StringWriter(); DOMImplementationLS domImpl = (DOMImplementationLS) document.getImplementation(); LSSerializer lsSerializer = domImpl.createLSSerializer(); lsSerializer.getDomConfig().setParameter(XML_DECLARATION, false); LSOutput lsout = domImpl.createLSOutput(); lsout.setEncoding(encoding); lsout.setCharacterStream(stringOut); NodeList childNodes = n.getChildNodes(); <START> for (int i = 0; i < childNodes.getLength(); i++) { <END> lsSerializer.write(childNodes.item(i), lsout); } return stringOut.toString(); } catch (DOMException | LSException e) { LOGGER.debug(e.getMessage(), e); } return null; }</code><technical_language>want understanding this correctly, previously childnodes are</technical_language>

Target:
public static String print(Node n, String encoding) { if (n == null) { return null; } try { Document document = null; if (n instanceof Document) { document = (Document) n; } else { document = n.getOwnerDocument(); } StringWriter stringOut = new StringWriter(); DOMImplementationLS domImpl = (DOMImplementationLS) document.getImplementation(); LSSerializer lsSerializer = domImpl.createLSSerializer(); lsSerializer.getDomConfig().setParameter(XML_DECLARATION, false); LSOutput lsout = domImpl.createLSOutput(); lsout.setEncoding(encoding); lsout.setCharacterStream(stringOut); if (n.getNodeType() == Node.ATTRIBUTE_NODE && n.hasChildNodes()) { n = n.getFirstChild(); } lsSerializer.write(n, lsout); return stringOut.toString(); } catch (DOMException | LSException e) { LOGGER.debug(e.getMessage(), e); } return null; }
Source:
<code>public void onCompletion(Void result, Exception exception) { callbackTracker.markOperationEnd(); if (exception == null) { try { RestMethod restMethod = restRequest.getRestMethod(); logger.trace("Forwarding to the IdConverter/Router", restMethod); switch (restMethod) { case GET: String receivedId = RestUtils.getRequestPath(restRequest).getOperationOrBlobId(false); InboundIdConverterCallback idConverterCallback = new InboundIdConverterCallback(restRequest, restResponseChannel, getCallback); idConverter.convert(restRequest, receivedId, idConverterCallback); break; case HEAD: receivedId = RestUtils.getRequestPath(restRequest).getOperationOrBlobId(false); idConverterCallback = new InboundIdConverterCallback(restRequest, restResponseChannel, headCallback); idConverter.convert(restRequest, receivedId, idConverterCallback); break; case DELETE: <START> receivedId = RestUtils.getRequestPath(restRequest).getOperationOrBlobId(false); <END> idConverterCallback = new InboundIdConverterCallback(restRequest, restResponseChannel, deleteCallback); idConverter.convert(restRequest, receivedId, idConverterCallback); break; default: exception = new IllegalStateException("Unrecognized RestMethod: " + restMethod); } } catch (Exception e) { exception = extractExecutionExceptionCause(e); } } if (exception != null) { submitResponse(restRequest, restResponseChannel, null, exception); } callbackTracker.markCallbackProcessingEnd(); }</code><technical_language>extract receivedId switch block? (reduce duplicate code)</technical_language>

Target:
public void onCompletion(Void result, Exception exception) { callbackTracker.markOperationEnd(); if (exception == null) { try { RestMethod restMethod = restRequest.getRestMethod(); logger.trace("Forwarding to the IdConverter/Router", restMethod); String receivedId = getRequestPath(restRequest).getOperationOrBlobId(false); switch (restMethod) { case GET: InboundIdConverterCallback idConverterCallback = new InboundIdConverterCallback(restRequest, restResponseChannel, getCallback); idConverter.convert(restRequest, receivedId, idConverterCallback); break; case HEAD: idConverterCallback = new InboundIdConverterCallback(restRequest, restResponseChannel, headCallback); idConverter.convert(restRequest, receivedId, idConverterCallback); break; case DELETE: idConverterCallback = new InboundIdConverterCallback(restRequest, restResponseChannel, deleteCallback); idConverter.convert(restRequest, receivedId, idConverterCallback); break; default: exception = new IllegalStateException("Unrecognized RestMethod: " + restMethod); } } catch (Exception e) { exception = extractExecutionExceptionCause(e); } } if (exception != null) { submitResponse(restRequest, restResponseChannel, null, exception); } callbackTracker.markCallbackProcessingEnd(); }
Source:
<code>@OnClick(R.id.gallery_cta_button) void onTranslateClick(View v) { GalleryItemFragment item = getCurrentItem(); if (item == null || item.getImageTitle() == null || item.getMediaInfo() == null || item.getMediaInfo().getMetadata() == null) { return; } <START> if (imageEditType != null) { <END> switch (imageEditType) { case ADD_TAGS: startTagsEdit(item); break; case ADD_CAPTION_TRANSLATION: startCaptionTranslation(item); break; default: startCaptionEdit(item); } } }</code><technical_language>Feels this null check included above</technical_language>

Target:
@OnClick(R.id.gallery_cta_button) void onTranslateClick(View v) { GalleryItemFragment item = getCurrentItem(); if (item == null || item.getImageTitle() == null || item.getMediaInfo() == null || item.getMediaInfo().getMetadata() == null || imageEditType == null) { return; } switch (imageEditType) { case ADD_TAGS: startTagsEdit(item); break; case ADD_CAPTION_TRANSLATION: startCaptionTranslation(item); break; default: startCaptionEdit(item); } }
Source:
<code><START> private static String toHex(String s) { <END> StringBuffer buf = null; try { buf = new StringBuffer(s.getBytes("UTF-8").length); for (byte x : s.getBytes("UTF-8")) { buf.append("%"); buf.append(Integer.toHexString(x & 0xFF)); } } catch (UnsupportedEncodingException e) { e.printStackTrace(); } return buf.toString().toUpperCase(); }</code><technical_language>Extra space</technical_language>

Target:
private static String toHex(String s) { StringBuffer buf; try { buf = new StringBuffer(s.getBytes("UTF-8").length); for (byte x : s.getBytes("UTF-8")) { buf.append("%"); buf.append(Integer.toHexString(x & 0xFF)); } } catch (UnsupportedEncodingException e) { throw new IllegalStateException(e); } return buf.toString().toUpperCase(); }
Source:
<code>private SmooshedWriter delegateSmooshedWriter(final String name,final long size) throws IOException { final File tmpFile = new File(baseDir, name); createFiles.add(tmpFile); return new SmooshedWriter () { private int currOffset = 0; private boolean open = true; private final FileOutputStream out = new FileOutputStream(tmpFile); @Override public void close() throws IOException { open = false; out.close(); files.add(tmpFile); if(!writerCurrentlyInUse ) { mergeWithSmoosher(); } } public int bytesLeft() { return (int) (size - currOffset); } @Override public int write(ByteBuffer buffer) throws IOException { FileChannel channel = out.getChannel(); int bytesWritten = channel.write(buffer); return addToOffset(bytesWritten); } @Override public int write(InputStream in) throws IOException { return addToOffset(Ints.checkedCast(java.nio.file.Files.copy(in, tmpFile.toPath()))); } <START> public int addToOffset(int numBytesWritten) <END> { if (numBytesWritten > bytesLeft()) { throw new ISE("Wrote more bytes[%,d] than available[%,d]. Don't do that.", numBytesWritten, bytesLeft()); } currOffset += numBytesWritten; return numBytesWritten; } @Override public boolean isOpen() { return open; } }; }</code><technical_language>This method a weird contract. 1. is public? 2. return incoming argument adjustment? name of method this returning total offset instead of size. methods in non-delegate writer do this call name "verify" clear intent of method is do some state checks..</technical_language>

Target:
private SmooshedWriter delegateSmooshedWriter(final String name, final long size) throws IOException { final File tmpFile = new File(baseDir, name); filesInProcess.add(tmpFile); return new SmooshedWriter() { private int currOffset = 0; private final FileOutputStream out = new FileOutputStream(tmpFile); private final GatheringByteChannel channel = out.getChannel();; private final Closer closer = Closer.create(); { closer.register(out); closer.register(channel); } @Override public void close() throws IOException { closer.close(); completedFiles.add(tmpFile); filesInProcess.remove(tmpFile); if (!writerCurrentlyInUse) { mergeWithSmoosher(); } } public int bytesLeft() { return (int) (size - currOffset); } @Override public int write(ByteBuffer buffer) throws IOException { return addToOffset(channel.write(buffer)); } @Override public int write(InputStream in) throws IOException { return addToOffset(ByteStreams.copy(Channels.newChannel(in), channel)); } @Override public long write(ByteBuffer[] srcs, int offset, int length) throws IOException { return addToOffset(channel.write(srcs, offset, length)); } @Override public long write(ByteBuffer[] srcs) throws IOException { return addToOffset(channel.write(srcs)); } public int addToOffset(long numBytesWritten) { if (numBytesWritten > bytesLeft()) { throw new ISE("Wrote more bytes[%,d] than available[%,d]. Don't do that.", numBytesWritten, bytesLeft()); } currOffset += numBytesWritten; return Ints.checkedCast(numBytesWritten); } @Override public boolean isOpen() { return channel.isOpen(); } }; }
Source:
<code>public String[] getSupportedExtensions() { return new String[] { "at3", "oma", "aa3", <START> "at9", <END> }; }</code><technical_language>@Nadahar I read PS3 .**atrac**. stream this kind of file PS3 ? **P.S.** .omg (from french Wikipedia) .msa well</technical_language>

Target:
public String[] getSupportedExtensions() { return new String[] { "aa3", "at3", "at9", "atrac", "msa", "oma", "omg" }; }
Source:
<code>public void theSetSpecialDaysRequestIsReceived() throws Throwable { <START> PROPERTIES_MAP.put(DEVICE_IDENTIFICATION_G_LABEL, this.deviceId.getDeviceIdG()); <END> PROPERTIES_MAP.put(ORGANISATION_IDENTIFICATION_LABEL, this.organisationId.getOrganisationId()); this.RequestRunner(PROPERTIES_MAP, TEST_CASE_NAME_REQUEST, TEST_CASE_XML, TEST_SUITE_XML); }</code><technical_language>SetSpecialDays tested E-meter DEVICE_IDENTIFICATION_G_LABEL -> DEVICE_IDENTIFICATION_E_LABEL getDeviceIdG -> getDeviceIdE</technical_language>

Target:
public void theSetSpecialDaysRequestIsReceived() throws Throwable { PROPERTIES_MAP.put(DEVICE_IDENTIFICATION_E_LABEL, this.deviceId.getDeviceIdE()); PROPERTIES_MAP.put(ORGANISATION_IDENTIFICATION_LABEL, this.organisationId.getOrganisationId()); this.RequestRunner(PROPERTIES_MAP, TEST_CASE_NAME_REQUEST, TEST_CASE_XML, TEST_SUITE_XML); }
Source:
<code>public String buildRunCommand() { final List<String> runCommand; if (importsZip == null || abstractEntryClient instanceof ToolClient || Objects.equals(languageType, LanguageType.WDL)) { runCommand = Lists.newArrayList(primaryDescriptor.getAbsolutePath(), "--inputs", provisionedParameterFile.getAbsolutePath()); } else { runCommand = Lists.newArrayList(primaryDescriptor.getAbsolutePath(), "--inputs", provisionedParameterFile.getAbsolutePath(), "--imports", importsZip.getAbsolutePath()); } <START> System.out.println("Calling out to " + LAUNCHER_NAME + " to run your workflow"); <END> final String[] s = { "java", "-jar", exectionFile.getAbsolutePath(), "run" }; List<String> arguments = new ArrayList<>(); arguments.addAll(Arrays.asList(s)); arguments.addAll(runCommand); final String join = Joiner.on(" ").join(arguments); System.out.println("Executing: " + join); return join; }</code><technical_language>LAUNCHER_NAME abstract method in base class, print this message in base class</technical_language>

Target:
public List<String> buildRunCommand() { final List<String> runCommand; if (zippedEntry == null || abstractEntryClient instanceof ToolClient || Objects.equals(languageType, LanguageType.WDL)) { runCommand = Lists.newArrayList(primaryDescriptor.getAbsolutePath(), "--inputs", provisionedParameterFile.getAbsolutePath()); } else { runCommand = Lists.newArrayList(primaryDescriptor.getAbsolutePath(), "--inputs", provisionedParameterFile.getAbsolutePath(), "--imports", zippedEntry .getAbsolutePath()); } final String[] s = { "java", "-jar", executionFile.getAbsolutePath(), "run" }; List<String> arguments = new ArrayList<>(); arguments.addAll(Arrays.asList(s)); arguments.addAll(runCommand); return arguments; }
Source:
<code>public Mono<CloseableChannel> start(ConnectionAcceptor acceptor, int mtu) { Objects.requireNonNull(acceptor, "acceptor must not be null"); return server .handle( (request, response) -> { transportHeaders.get().forEach(response::addHeader); return response.sendWebsocket( null, <START> Math.max(DEFAULT_FRAME_SIZE, mtu == 0 ? FRAME_MAX_SIZE : mtu), <END> (in, out) -> { DuplexConnection connection = new WebsocketDuplexConnection((Connection) in); if (mtu > 0) { connection = new FragmentationDuplexConnection( connection, ByteBufAllocator.DEFAULT, mtu, false); } return acceptor.apply(connection).then(out.neverComplete()); }); }) .bind() .map(CloseableChannel::new); }</code><technical_language>is this doing? Is a reason setting max frame size rsocket max frame size</technical_language>

Target:
public Mono<CloseableChannel> start(ConnectionAcceptor acceptor, int mtu) { Objects.requireNonNull(acceptor, "acceptor must not be null"); return server .handle( (request, response) -> { transportHeaders.get().forEach(response::addHeader); return response.sendWebsocket( null, FRAME_LENGTH_MASK, (in, out) -> { DuplexConnection connection = new WebsocketDuplexConnection((Connection) in); if (mtu > 0) { connection = new FragmentationDuplexConnection( connection, ByteBufAllocator.DEFAULT, mtu, false); } return acceptor.apply(connection).then(out.neverComplete()); }); }) .bind() .map(CloseableChannel::new); }
Source:
<code>private ClusteringModel pmmlClusteringModel(KMeansModel model, Map<Integer,Long> clusterSizesMap) { ClusteringModel clusteringModel = new ClusteringModel(AppPMMLUtils.buildMiningSchema(inputSchema), new ComparisonMeasure(ComparisonMeasure.Kind.DISTANCE) .withMeasure(new SquaredEuclidean()), MiningFunctionType.CLUSTERING, ClusteringModel.ModelClass.CENTER_BASED, model.clusterCenters().length) .withNumberOfClusters(model.k()); if (initializationStrategy.equals(KMeans.K_MEANS_PARALLEL())) { clusteringModel.setAlgorithmName("K-Means||"); } else if (initializationStrategy.equals(KMeans.RANDOM())) { clusteringModel.setAlgorithmName("random"); } Vector[] clusterCenters = model.clusterCenters(); for (int i = 0; i < clusterCenters.length; i++) { FieldName field = FieldName.create("field_" + i); clusteringModel.getClusteringFields().add( new ClusteringField(field).withCompareFunction(CompareFunctionType.ABS_DIFF)); <START> clusteringModel.getClusters().add(toCluster(clusterCenters[i], i, (int)clusterSizesMap.get(i).longValue())); <END> } return clusteringModel; }</code><technical_language>call intValue() is cast</technical_language>

Target:
private ClusteringModel pmmlClusteringModel(KMeansModel model, Map<Integer,Long> clusterSizesMap) { ClusteringModel clusteringModel = new ClusteringModel(AppPMMLUtils.buildMiningSchema(inputSchema), new ComparisonMeasure(ComparisonMeasure.Kind.DISTANCE) .withMeasure(new SquaredEuclidean()), MiningFunctionType.CLUSTERING, ClusteringModel.ModelClass.CENTER_BASED, model.clusterCenters().length) .withNumberOfClusters(model.k()); if (initializationStrategy.equals(KMeans.K_MEANS_PARALLEL())) { clusteringModel.setAlgorithmName("K-Means||"); } else if (initializationStrategy.equals(KMeans.RANDOM())) { clusteringModel.setAlgorithmName("random"); } Vector[] clusterCenters = model.clusterCenters(); for (int i = 0; i < clusterCenters.length; i++) { FieldName field = FieldName.create("field_" + i); clusteringModel.getClusteringFields().add( new ClusteringField(field).withCompareFunction(CompareFunctionType.ABS_DIFF)); clusteringModel.getClusters().add(toCluster(clusterCenters[i], i, clusterSizesMap.get(i).intValue())); } return clusteringModel; }
Source:
<code>private List<Target> computeTargets(final ArgumentParser parser, final List<String> explicitEndpoints, final List<String> domainsArguments, final String srvName) { if (explicitEndpoints != null && !explicitEndpoints.isEmpty()) { final List<Target> targets = Lists.newArrayListWithExpectedSize(explicitEndpoints.size()); for (final String endpoint : explicitEndpoints) { targets.add(ExplicitTarget.from(URI.create(endpoint))); } return targets; } else if (domainsArguments != null && !domainsArguments.isEmpty()) { final Iterable<String> sites = parseDomains(domainsArguments); <START> return SrvTarget.from(srvName, sites); <END> } else if (!cliConfig.getMasterEndpoints().isEmpty()) { final List<URI> cliConfigMasterEndpoints = cliConfig.getMasterEndpoints(); List<Target> targets = Lists.newArrayListWithExpectedSize(cliConfigMasterEndpoints.size()); for (final URI endpoint : cliConfigMasterEndpoints) { targets.add(ExplicitTarget.from(endpoint)); } return targets; } else if (!cliConfig.getSitesString().isEmpty()) { final Iterable<String> sites = parseDomainsString(cliConfig.getSitesString()); return SrvTarget.from(srvName, sites); } handleError(parser, new ArgumentParserException( "no masters specified. Use the -z or -d option to specify which helios " + "cluster/master to connect to", parser)); return ImmutableList.of(); }</code><technical_language>I change return type List<? extends Target></technical_language>

Target:
private List<Target> computeTargets(final ArgumentParser parser, final List<String> explicitEndpoints, final List<String> domainsArguments, final String srvName) { if (explicitEndpoints != null && !explicitEndpoints.isEmpty()) { final List<Target> targets = Lists.newArrayListWithExpectedSize(explicitEndpoints.size()); for (final String endpoint : explicitEndpoints) { targets.add(Target.from(URI.create(endpoint))); } return targets; } else if (domainsArguments != null && !domainsArguments.isEmpty()) { final Iterable<String> sites = parseDomains(domainsArguments); return Target.from(srvName, sites); } else if (!cliConfig.getMasterEndpoints().isEmpty()) { final List<URI> cliConfigMasterEndpoints = cliConfig.getMasterEndpoints(); List<Target> targets = Lists.newArrayListWithExpectedSize(cliConfigMasterEndpoints.size()); for (final URI endpoint : cliConfigMasterEndpoints) { targets.add(Target.from(endpoint)); } return targets; } else if (!cliConfig.getSitesString().isEmpty()) { final Iterable<String> sites = parseDomainsString(cliConfig.getSitesString()); return Target.from(srvName, sites); } handleError(parser, new ArgumentParserException( "no masters specified. Use the -z or -d option to specify which helios " + "cluster/master to connect to", parser)); return ImmutableList.of(); }
Source:
<code>void processNotification(OSNotification originalNotification, @Nullable OSNotification notification) { OneSignal.onesignalLog(OneSignal.LOG_LEVEL.DEBUG, "processNotification called from Thread: " + Thread.currentThread().toString()); if (notification != null) { boolean display = isStringEmpty(notification.getBody()); if (!display) { notDisplayNotificationLogic(originalNotification); } else { notificationJob.setNotification(notification); <START> NotificationBundleProcessor.processJobForDisplay(this, isBackgroundLogic); <END> } if (isRestoring) OSUtils.sleep(100); } else { notDisplayNotificationLogic(originalNotification); } }</code><technical_language>This is passing isBackgroundLogic param name for processJobForDisplay is callForegroundLogic. flipping logic not? of names wrong</technical_language>

Target:
void processNotification(OSNotification originalNotification, @Nullable OSNotification notification) { if (notification != null) { boolean display = isStringEmpty(notification.getBody()); if (!display) { notDisplayNotificationLogic(originalNotification); } else { notificationJob.setNotification(notification); NotificationBundleProcessor.processJobForDisplay(this, fromBackgroundLogic); } if (restoring) OSUtils.sleep(100); } else { notDisplayNotificationLogic(originalNotification); } }
Source:
<code>public void missingMapping(RegistryEvent.MissingMappings<Item> event) { for (MissingMappings.Mapping<Item> entry : event.getAllMappings()) { if (entry.key.toString().equals("minecraft:totem")) { ResourceLocation newTotem = new ResourceLocation("minecraft:totem_of_undying"); entry.remap(ForgeRegistries.ITEMS.getValue(newTotem)); } <START> if (entry.key.toString().equals("forge:bucketFilled")) <END> { ResourceLocation newBucket = new ResourceLocation("forge:bucket_filled"); entry.remap(ForgeRegistries.ITEMS.getValue(newBucket)); } } }</code><technical_language>pretty ends cased registries do support capital letters</technical_language>

Target:
public void missingMapping(RegistryEvent.MissingMappings<Item> event) { for (MissingMappings.Mapping<Item> entry : event.getAllMappings()) { if (entry.key.toString().equals("minecraft:totem")) { ResourceLocation newTotem = new ResourceLocation("minecraft:totem_of_undying"); entry.remap(ForgeRegistries.ITEMS.getValue(newTotem)); } if (entry.key.toString().equals("forge:bucketfilled")) { ResourceLocation newBucket = new ResourceLocation("forge:bucket_filled"); entry.remap(ForgeRegistries.ITEMS.getValue(newBucket)); } } }
Source:
<code>public ProductInfo updateProduct(String productId, ProductInfo pinfo) { if (productId == null) { throw new IllegalArgumentException("productId is null"); } if (pinfo == null) { throw new IllegalArgumentException("pinfo is null"); } ProductData pdata = this.productMap.get(productId); if (pdata == null) { throw new IllegalStateException("product does not exist: " + productId); } <START> Collection<ProductContentData> pcdata = this.resolveProductContent(pdata.getProductContent()); <END> if (pcdata != null) { pdata.setProductContent(pcdata); } if (pinfo.getName() != null) { pdata.setName(pinfo.getName()); } if (pinfo.getMultiplier() != null) { pdata.setMultiplier(pinfo.getMultiplier()); } if (pinfo.getAttributes() != null) { pdata.setAttributes(pinfo.getAttributes()); } if (pinfo.getDependentProductIds() != null) { pdata.setDependentProductIds(pinfo.getDependentProductIds()); } if (pinfo.getBranding() != null) { pdata.setBranding(this.resolveBranding(pinfo.getBranding())); } this.updateProductContentMappings(pdata); pdata.setUpdated(new Date()); return pdata; }</code><technical_language>is this changed? want resolve product content incoming data (pinfo) existing product (pdata)</technical_language>

Target:
public ProductInfo updateProduct(String productId, ProductInfo pinfo) { if (productId == null) { throw new IllegalArgumentException("productId is null"); } if (pinfo == null) { throw new IllegalArgumentException("pinfo is null"); } ProductData pdata = this.productMap.get(productId); if (pdata == null) { throw new IllegalStateException("product does not exist: " + productId); } Collection<ProductContentData> pcdata = this.resolveProductContent(pinfo.getProductContent()); if (pcdata != null) { pdata.setProductContent(pcdata); } if (pinfo.getName() != null) { pdata.setName(pinfo.getName()); } if (pinfo.getMultiplier() != null) { pdata.setMultiplier(pinfo.getMultiplier()); } if (pinfo.getAttributes() != null) { pdata.setAttributes(pinfo.getAttributes()); } if (pinfo.getDependentProductIds() != null) { pdata.setDependentProductIds(pinfo.getDependentProductIds()); } if (pinfo.getBranding() != null) { pdata.setBranding(this.resolveBranding(pinfo.getBranding())); } this.updateProductContentMappings(pdata); pdata.setUpdated(new Date()); return pdata; }
Source:
<code>public void injectHooks() { HookFile hookFile = fetchHookFile(); if (hookFile == null) { return; } HookParser parser = hookFile.getParser(); Injectable[] injectables = parser.getInjectables(); if (injectables == null) { return; } int index = 0; try { for (Injectable inj : injectables) { inj.inject(); index++; } } catch (NullPointerException ex) { if(!crashed) { Injectable inj = injectables[index]; <START> int resp = UILog.alert("Outdated client", "This server currently has outdated hooks, please report it to a member of the Parabot staff/Dev Team.\r\n\r\n" + <END> "Broken hook:\r\n"+inj, new Object[]{"Close", "Report here..."}, JOptionPane.ERROR_MESSAGE); if(resp == 1) { URI uri = URI.create(Configuration.COMMUNITY + "forum/135-reports/"); try { Desktop.getDesktop().browse(uri); } catch (IOException ignore) } } crashed = true; throw ex; } Context.getInstance().setHookParser(parser); }</code><technical_language>Remove /Dev Team</technical_language>

Target:
public void injectHooks() { HookFile hookFile = fetchHookFile(); if (hookFile == null) { return; } HookParser parser = hookFile.getParser(); Injectable[] injectables = parser.getInjectables(); if (injectables == null) { return; } int index = 0; try { for (Injectable inj : injectables) { inj.inject(); index++; } } catch (NullPointerException ex) { if(!crashed) { Injectable inj = injectables[index]; int resp = UILog.alert("Outdated client", "This server currently has outdated hooks, please report it to a member of the Parabot staff.\r\n\r\n" + "Broken hook:\r\n"+inj, new Object[]{"Close", "Report here..."}, JOptionPane.ERROR_MESSAGE); if(resp == 1) { URI uri = URI.create(Configuration.COMMUNITY_PAGE + "forum/135-reports/"); try { Desktop.getDesktop().browse(uri); } catch (IOException ignore) } } crashed = true; throw ex; } Context.getInstance().setHookParser(parser); }
Source:
<code>public void execute(TupleWindow inputWindow) { for (Tuple tuple : inputWindow.get()) { sum += tuple.getLongByField("value"); } <START> state.put("sum", sum); <END> collector.emit(new Values(sum)); }</code><technical_language>move this line preSave. topoliogy in effectively atleast/atmost mode</technical_language>

Target:
public void execute(TupleWindow inputWindow) { for (Tuple tuple : inputWindow.get()) { sum += tuple.getLongByField("value"); } collector.emit(new Values(sum)); }
Source:
<code>private CDPStructuredNotificationDetails getNotificationDetails(ResourceEvent resourceEvent, String resourceCrn, String resourceType, Object payload) { String serializedPayload; try { serializedPayload = new Gson().toJson(payload); LOGGER.debug("CDPStructuredNotificationDetails' payload has been serialized with ResourceEvent[{}], resource type[{}], CRN[{}]", resourceEvent.name(), resourceType, resourceCrn); } catch (RuntimeException re) { <START> String msg = String.format("CDPStructuredNotificationDetails' payload couldn't be serialized with ResourceEvent[%s], resource type[%s], CRN[%s]", <END> resourceEvent.name(), resourceType, resourceCrn); LOGGER.warn(msg, re); serializedPayload = msg; } return new CDPStructuredNotificationDetails(resourceEvent, resourceCrn, resourceType, serializedPayload); }</code><technical_language>I reason introduce msg here, serializedPayload</technical_language>

Target:
private CDPStructuredNotificationDetails getNotificationDetails(ResourceEvent resourceEvent, String resourceCrn, String resourceType, Object payload) { String serializedPayload; try { serializedPayload = new Gson().toJson(payload); LOGGER.debug("CDPStructuredNotificationDetails' payload has been serialized with ResourceEvent[{}], resource type[{}], CRN[{}]", resourceEvent.name(), resourceType, resourceCrn); } catch (RuntimeException re) { serializedPayload = format("CDPStructuredNotificationDetails' payload couldn't be serialized with ResourceEvent[%s], resource type[%s], CRN[%s]", resourceEvent.name(), resourceType, resourceCrn); LOGGER.warn(serializedPayload, re); } return new CDPStructuredNotificationDetails(resourceEvent, resourceCrn, resourceType, serializedPayload); }
Source:
<code><START> public static Map<String, String> getInputFiles(String descriptorAbsolutePath) { <END> WdlBridge wdlBridge = new WdlBridge(); Map<String, String> wdlInputs = null; try { wdlInputs = wdlBridge.getInputFiles(descriptorAbsolutePath); } catch (WdlParser.SyntaxError ex) { exceptionMessage(ex, "Problem parsing WDL file: " + ex.getMessage(), API_ERROR); } return wdlInputs; }</code><technical_language>Put test in package (not directory) package private protected</technical_language>

Target:
static Map<String, String> getInputFiles(String descriptorAbsolutePath) { WdlBridge wdlBridge = new WdlBridge(); Map<String, String> wdlInputs = null; try { wdlInputs = wdlBridge.getInputFiles(descriptorAbsolutePath); } catch (WdlParser.SyntaxError ex) { exceptionMessage(ex, "Problem parsing WDL file: " + ex.getMessage(), API_ERROR); } return wdlInputs; }