auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int hashCode() { return Objects.hash(id, name); }

Target:
public int hashCode() { return Objects.hash(name, displayName); }
Source:
public void terminateCanBeCalledEvenIfWorkerHasNotBeenActivated() throws Exception { verifierWebWorkerConnection.terminate(); assertTrue("You shall pass!", true); }

Target:
public void terminateCanBeCalledEvenIfWorkerHasNotBeenActivated() throws Exception { verifierWebWorkerConnection.activate(); verifierWebWorkerConnection.terminate(); verify(worker).terminate(); }
Source:
private Long createdAt( final Release release ) { try { final Release.Smart smart = new Release.Smart(release); final Date created = smart.createdAt(); if (created != null) { return created.getTime(); } } catch (final IOException iox) { } return 0L; }

Target:
private long createdAt(final Release release) { long result = 0; try { final Date created = this.smart(release).createdAt(); if (created != null) { result = created.getTime(); } } catch (final IOException iox) { throw new IllegalArgumentException(iox); } return result; }
Source:
protected void onInitUI() { super.onInitUI(); setHeaderVisible(false); Resources.I.style().ensureInjected(); star.setVisible(Gerrit.isSignedIn()); labels.init(style, statusText); reviewers.init(style); keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation()); keysNavigation.add(new KeyCommand(0, 'u', Util.C.upToChangeList()) { @Override public void onKeyPress(final KeyPressEvent event) { Gerrit.displayLastChangeList(); } }); keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReload()) { @Override public void onKeyPress(final KeyPressEvent event) { reload.reload(); } }); keysAction = new KeyCommandSet(Gerrit.C.sectionActions()); keysAction.add(new KeyCommand(0, 'a', Util.C.keyPublishComments()) { @Override public void onKeyPress(KeyPressEvent event) { if (Gerrit.isSignedIn()) { onReply(null); } else { Gerrit.doSignIn(getToken()); } } }); if (Gerrit.isSignedIn()) { keysAction.add(new KeyCommand(0, 's', Util.C.changeTableStar()) { @Override public void onKeyPress(KeyPressEvent event) { star.setValue(!star.getValue(), true); } }); keysAction.add(new KeyCommand(0, 'f', Util.C.keyEditReviewers()) { @Override public void onKeyPress(KeyPressEvent event) { reviewers.onEdit(); } }); } }

Target:
protected void onInitUI() { super.onInitUI(); setHeaderVisible(false); Resources.I.style().ensureInjected(); star.setVisible(Gerrit.isSignedIn()); labels.init(style, statusText); reviewers.init(style); keysNavigation = new KeyCommandSet(Gerrit.C.sectionNavigation()); keysNavigation.add(new KeyCommand(0, 'u', Util.C.upToChangeList()) { @Override public void onKeyPress(final KeyPressEvent event) { Gerrit.displayLastChangeList(); } }); keysNavigation.add(new KeyCommand(0, 'R', Util.C.keyReload()) { @Override public void onKeyPress(final KeyPressEvent event) { reload.reload(); } }); keysAction = new KeyCommandSet(Gerrit.C.sectionActions()); keysAction.add(new KeyCommand(0, 'a', Util.C.keyPublishComments()) { @Override public void onKeyPress(KeyPressEvent event) { if (Gerrit.isSignedIn()) { onReply(null); } else { Gerrit.doSignIn(getToken()); } } }); if (Gerrit.isSignedIn()) { keysAction.add(new KeyCommand(0, 's', Util.C.changeTableStar()) { @Override public void onKeyPress(KeyPressEvent event) { star.setValue(!star.getValue(), true); } }); keysAction.add(new KeyCommand(0, 'c', Util.C.keyEditReviewers()) { @Override public void onKeyPress(KeyPressEvent event) { reviewers.onEdit(); } }); } }
Source:
public ResponseEntity addUser(Authentication authentication) { return ResponseEntity .status(HttpStatus.CREATED) .body("{\"ok\":\"user '" + authentication.getName() + "' created\"}"); }

Target:
public ResponseEntity addUser(Authentication authentication) { if (authentication == null || !authentication.isAuthenticated()) { throw new InsufficientAuthenticationException("unauthorized"); } if (!(authentication instanceof UsernamePasswordAuthenticationToken)) { return toResponseEntityError("Unsupported authentication class " + authentication.getClass().getName()); } Object principal = authentication.getPrincipal(); if (!(principal instanceof SpringSecurityUser)) { return toResponseEntityError( "Unsupported authentication principal " + Optional.ofNullable(principal).orElse(null)); } return ResponseEntity .status(HttpStatus.CREATED) .body("{\"ok\":\"user '" + authentication.getName() + "' created\"}"); }
Source:
public ImportResult importSpreadsheet(File file, EClass eClass) { final BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext(); final ServiceReference<ReportService> serviceReference = bundleContext.getServiceReference(ReportService.class); final ReportService reportService = bundleContext.getService(serviceReference); Workbook workbook = null; FileInputStream inputStream = null; try { inputStream = new FileInputStream(file); workbook = new HSSFWorkbook(inputStream); } catch (final IOException ex) { reportService.report(new EMFFormsSpreadsheetReport(ex, 4)); } finally { try { inputStream.close(); } catch (final IOException ex) { reportService.report(new EMFFormsSpreadsheetReport(ex, 4)); } } bundleContext.ungetService(serviceReference); if (workbook == null) { return null; } final ImportResult result = EMFFormsSpreadsheetImporter.INSTANCE.importSpreadsheet(workbook, eClass); return result; }

Target:
public SpreadsheetImportResult importSpreadsheet(File file, EClass eClass) { final BundleContext bundleContext = FrameworkUtil.getBundle(getClass()).getBundleContext(); final ServiceReference<ReportService> serviceReference = bundleContext.getServiceReference(ReportService.class); final ReportService reportService = bundleContext.getService(serviceReference); Workbook workbook = null; FileInputStream inputStream = null; try { inputStream = new FileInputStream(file); workbook = new HSSFWorkbook(inputStream); } catch (final IOException ex) { reportService.report(new EMFFormsSpreadsheetReport(ex, 4)); } finally { try { inputStream.close(); } catch (final IOException ex) { reportService.report(new EMFFormsSpreadsheetReport(ex, 4)); } } bundleContext.ungetService(serviceReference); if (workbook == null) { final SpreadsheetImportResult result = ErrorFactory.eINSTANCE.createSpreadsheetImportResult(); result.reportError(Severity.CANCEL, Messages.EMFFormsSpreadsheetFileImporterImpl_FileNotAWorkbook); return result; } final SpreadsheetImportResult result = EMFFormsSpreadsheetImporter.INSTANCE.importSpreadsheet(workbook, eClass); return result; }
Source:
public Integer getWaitForResponses() { if (waitForResponses == null) { return 0; } else if (waitForResponses == -1) { return Integer.MAX_VALUE; } else { return waitForResponses; } }

Target:
public Integer getWaitForResponses() { if (waitForResponses == null) { return 0; } else { return waitForResponses; } }
Source:
public void addFirstPartWithIconTest() { SVGResource titleSVGResource = mock(SVGResource.class); SVGImage svgImage = mock(SVGImage.class); OMSVGSVGElement svgElem = mock(OMSVGSVGElement.class); doReturn(svgElem).when(titleSVGResource).getSvg(); doReturn(GWT.create(Node.class)).when(svgElem).getElement(); doReturn(titleSVGResource).when(part1).getTitleSVGImage(); doReturn(svgImage).when(part1).decorateIcon(any(SVGImage.class)); doReturn(item).when(view).addTabButton(svgImage, null, null, null, true); presenter.addPart(part1); stopSchedulers(); verify(part1).getTitleSVGImage(); verify(part1).decorateIcon(any(SVGImage.class)); }

Target:
public void addFirstPartWithIconTest() { presenter.addPart(part1); stopSchedulers(); verify(part1).getTitleSVGImage(); verify(part1).decorateIcon(any(SVGImage.class)); }
Source:
public void testRetrieveCollecton() throws ItemNotFoundException, IllegalOperationException, IOException, AccessDeniedException, NoSuchResourceStoreException { final String collectionPath = "/dir"; final StorageItem item = unzipRepo.doRetrieveItem(new ResourceStoreRequest(collectionPath)); Assert.assertTrue(item instanceof ZipAwareStorageCollectionItem); final StorageCollectionItem collectionItem = (StorageCollectionItem) item; Assert.assertEquals(collectionPath, collectionItem.getPath()); TestUtil.assertMembers(new String[] { "/dir/subdir" }, new String[0], collectionItem.list()); }

Target:
public void testRetrieveCollecton() throws Exception { final String collectionPath = "/dir"; final StorageItem item = unzipRepo.doRetrieveItem(new ResourceStoreRequest(collectionPath)); Assert.assertTrue(item instanceof ZipAwareStorageCollectionItem); final StorageCollectionItem collectionItem = (StorageCollectionItem) item; Assert.assertEquals(collectionPath, collectionItem.getPath()); TestUtil.assertMembers(new String[] { "/dir/subdir" }, new String[0], collectionItem.list()); }
Source:
public Collection<MessagePathParameter<?>> getPathParameters() { return Collections.unmodifiableCollection(Arrays.asList( logFileNamePathParameter )); }

Target:
public Collection<MessagePathParameter<?>> getPathParameters() { return Collections.singleton(logFileNamePathParameter); }
Source:
public APICategory getAPICategoryByID(String apiCategoryId) throws APIManagementException { APICategory apiCategory = ApiMgtDAO.getInstance().getAPICategoryByID(apiCategoryId); if (apiCategory != null) { return apiCategory; }else { String msg = "Failed to get APICategory. API category corresponding to UUID " + apiCategoryId + " does not exist"; log.error(msg); throw new APIMgtResourceNotFoundException(msg); } }

Target:
public APICategory getAPICategoryByID(String apiCategoryId) throws APIManagementException { APICategory apiCategory = ApiMgtDAO.getInstance().getAPICategoryByID(apiCategoryId); if (apiCategory != null) { return apiCategory; }else { String msg = "Failed to get APICategory. API category corresponding to UUID " + apiCategoryId + " does not exist"; throw new APIMgtResourceNotFoundException(msg); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof GraphiteEmitterConfig)) { return false; } GraphiteEmitterConfig that = (GraphiteEmitterConfig) o; if (getPort() != that.getPort()) { return false; } if (getBatchSize() != that.getBatchSize()) { return false; } if (!getHostname().equals(that.getHostname())) { return false; } if (!getFlushPeriod().equals(that.getFlushPeriod())) { return false; } if (!getMaxQueueSize().equals(that.getMaxQueueSize())) { return false; } if (!getDruidToGraphiteEventConverter().equals(that.getDruidToGraphiteEventConverter())) { return false; } if (getAlertEmitters() != null ? !getAlertEmitters().equals(that.getAlertEmitters()) : that.getAlertEmitters() != null) { return false; } if (getRequestLogEmitters() != null ? !getRequestLogEmitters().equals(that.getRequestLogEmitters()) : that.getRequestLogEmitters() != null) { return false; } if (!getEmitWaitTime().equals(that.getEmitWaitTime())) { return false; } return getWaitForEventTime().equals(that.getWaitForEventTime()); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof GraphiteEmitterConfig)) { return false; } GraphiteEmitterConfig that = (GraphiteEmitterConfig) o; if (getPort() != that.getPort()) { return false; } if (getBatchSize() != that.getBatchSize()) { return false; } if (!getProtocol().equals(that.getProtocol())) { return false; } if (!getHostname().equals(that.getHostname())) { return false; } if (!getFlushPeriod().equals(that.getFlushPeriod())) { return false; } if (!getMaxQueueSize().equals(that.getMaxQueueSize())) { return false; } if (!getDruidToGraphiteEventConverter().equals(that.getDruidToGraphiteEventConverter())) { return false; } if (getAlertEmitters() != null ? !getAlertEmitters().equals(that.getAlertEmitters()) : that.getAlertEmitters() != null) { return false; } if (getRequestLogEmitters() != null ? !getRequestLogEmitters().equals(that.getRequestLogEmitters()) : that.getRequestLogEmitters() != null) { return false; } if (!getEmitWaitTime().equals(that.getEmitWaitTime())) { return false; } return getWaitForEventTime().equals(that.getWaitForEventTime()); }
Source:
public void updateImplementations(String schema, Stream<UserDefinedFunctionMetaData> userDefinedFunctions) { final Map<FunctionName, List<FuncResolver>> implementations = new HashMap<>(); Iterator<UserDefinedFunctionMetaData> it = userDefinedFunctions.iterator(); while (it.hasNext()) { UserDefinedFunctionMetaData udf = it.next(); FuncResolver resolver = buildFunctionResolver(udf); if (resolver == null) { continue; } implementations.compute( new FunctionName(udf.schema(), udf.name()), (key, resolvers) -> { if (resolvers == null) { resolvers = new ArrayList<>(); } resolvers.add(resolver); return resolvers; }); } functions.registerUdfFunctionImplementationsForSchema(schema, implementations); }

Target:
public void updateImplementations(String schema, Stream<UserDefinedFunctionMetaData> userDefinedFunctions) { final Map<FunctionName, List<FuncResolver>> implementations = new HashMap<>(); Iterator<UserDefinedFunctionMetaData> it = userDefinedFunctions.iterator(); while (it.hasNext()) { UserDefinedFunctionMetaData udf = it.next(); FuncResolver resolver = buildFunctionResolver(udf); if (resolver == null) { continue; } var functionName = new FunctionName(udf.schema(), udf.name()); var resolvers = implementations.computeIfAbsent( functionName, k -> new ArrayList<>()); resolvers.add(resolver); } functions.registerUdfFunctionImplementationsForSchema(schema, implementations); }
Source:
public boolean within(final LineRange range) { return range != null && range.first() >= this.first() && range.last() <= this.last(); }

Target:
public boolean within(final LineRange range) { return range.first() >= this.first() && range.last() <= this.last(); }
Source:
public static AppConfig parseAppConfig(String appConfigString) { AppConfig appConfig = new AppConfig(); try { JSONObject parentObj = new JSONObject(appConfigString); appConfig.setAppFormatVersion(parentObj.getLong("appFormatVersion")); if (appConfig.appFormatVersion >= 6) { JSONObject rootPage = parentObj.getJSONObject("rootPage"); appConfig.mRootPageArgs = rootPage.getJSONObject("args"); appConfig.mRootPageName = rootPage.getString("page"); appConfig.mAppConfigString = appConfig.mRootPageArgs.toString(); appConfig.mNotifications = parentObj.optBoolean("notifications"); } else { throw new RuntimeException("Not Supported appFormatVersion"); } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } return appConfig; }

Target:
public static AppConfig parseAppConfig(String appConfigString) { AppConfig appConfig = new AppConfig(); try { JSONObject parentObj = new JSONObject(appConfigString); appConfig.setAppFormatVersion(parentObj.getLong("appFormatVersion")); if (appConfig.appFormatVersion >= SUPPORTED_APP_FORMAT_VERSION) { JSONObject rootPage = parentObj.getJSONObject("rootPage"); appConfig.mRootPageArgs = rootPage.getJSONObject("args"); appConfig.mRootPageName = rootPage.getString("page"); appConfig.mAppConfigString = appConfig.mRootPageArgs.toString(); appConfig.mNotifications = parentObj.optBoolean("notifications"); } else { throw new RuntimeException("Not Supported appFormatVersion"); } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } return appConfig; }
Source:
public void authenticateUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final AuthenticationService authenticationService = adapter.create(AuthenticationService.class); authenticationService.authenticateUser(OTP, AUTHORIZATION, new AuthenticationRequest("foobar"), new RetrofitPromise<AuthenticationResponse>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/tokens", MOCK_URL)); Assert.assertTrue(bodyRef.get().getHeaders().contains(new Header("X-Bitreserve-OTP", OTP))); Assert.assertTrue(bodyRef.get().getHeaders().contains(new Header("Authorization", AUTHORIZATION))); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); }

Target:
public void authenticateUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final String mockUrl = "<LINK_0>"; final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(mockUrl).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final AuthenticationService authenticationService = adapter.create(AuthenticationService.class); authenticationService.authenticateUser("foobar", "authorizationfoobar", new AuthenticationRequest("foobar"), new RetrofitPromise<AuthenticationResponse>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "POST"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me/tokens", mockUrl)); Assert.assertTrue(bodyRef.get().getHeaders().contains(new Header("Authorization", "authorizationfoobar"))); Assert.assertTrue(bodyRef.get().getHeaders().contains(new Header("X-Bitreserve-OTP", "foobar"))); }
Source:
private void safelyAddProperty(Properties properties, String key, KualiDecimal value) { properties.put(key, ObjectUtils.isNull(value) ? KFSConstants.EMPTY_STRING : value.floatValue()); }

Target:
private void safelyAddProperty(Properties properties, String key, KualiDecimal value) { properties.put(key, ObjectUtils.isNull(value) ? KFSConstants.EMPTY_STRING : value.toString()); }
Source:
public void afterPropertiesSet() { Assert.notNull(codeListTable, "codeListTable is not initialized!"); Assert.isTrue(codeListTable.containsRow(fallbackTo), "No codelist found for locale '" + fallbackTo + "', it must be defined."); }

Target:
public void afterPropertiesSet() { Assert.notNull(codeListTable, "codeListTable is not initialized!"); Assert.isTrue(codeListTable.containsRow(fallbackTo), "No codelist found for fallback locale '" + fallbackTo + "', it must be defined."); }
Source:
public static double quantileAtValueBigint(@SqlType("qdigest(bigint)") Slice input, @SqlType(StandardTypes.BIGINT) long value) { QuantileDigest digest = new QuantileDigest(input); if (digest.getCount() == 0) return 1.0; double bucketCount = digest.getHistogram(ImmutableList.of(value)).get(0).getCount(); return bucketCount / digest.getCount(); }

Target:
public static Double quantileAtValueBigint(@SqlType("qdigest(bigint)") Slice input, @SqlType(StandardTypes.BIGINT) long value) { QuantileDigest digest = new QuantileDigest(input); if (digest.getCount() == 0 || value > digest.getMax() || value < digest.getMin()) { return null; } double bucketCount = digest.getHistogram(ImmutableList.of(value)).get(0).getCount(); return bucketCount / digest.getCount(); }
Source:
public void mergeWith(UnweightedDoubleReservoirSample other) { if (other.count < other.maxSamples) { Arrays.stream(other.elements).forEach(o -> add(o)); return; } if (count < maxSamples) { final UnweightedDoubleReservoirSample target = ((UnweightedDoubleReservoirSample) other.clone()); Arrays.stream(elements).forEach(o -> target.add(o)); count = target.count; maxSamples = target.maxSamples; elements = target.elements; return; } shuffleArray(elements); shuffleArray(other.elements); int nextIndex = 0; int otherNextIndex = 0; double[] merged = new double[maxSamples]; for (int i = 0; i < maxSamples; ++i) { if (ThreadLocalRandom.current().nextLong(0, count + other.count) < count) { merged[i] = elements[nextIndex++]; } else { merged[i] = other.elements[otherNextIndex++]; } } count += other.count; elements = merged; }

Target:
public void mergeWith(UnweightedDoubleReservoirSample other) { checkArgument(samples.length == other.samples.length, "Max samples must be equal"); if (other.count < other.samples.length) { Arrays.stream(other.samples).forEach(o -> add(o)); return; } if (count < samples.length) { final UnweightedDoubleReservoirSample target = ((UnweightedDoubleReservoirSample) other.clone()); Arrays.stream(samples).forEach(o -> target.add(o)); count = target.count; samples = target.samples; return; } shuffleArray(samples); shuffleArray(other.samples); int nextIndex = 0; int otherNextIndex = 0; double[] merged = new double[samples.length]; for (int i = 0; i < samples.length; ++i) { if (ThreadLocalRandom.current().nextLong(0, count + other.count) < count) { merged[i] = samples[nextIndex++]; } else { merged[i] = other.samples[otherNextIndex++]; } } count += other.count; samples = merged; }
Source:
Iterable<ProgramState> startingStates(String signature, ProgramState currentState, boolean isStaticMethod) { int parameterIdx = 0; ProgramState state = currentState; if(!isStaticMethod) { SymbolicValue thisSV = constraintManager.createSymbolicValue((Instruction) null); Type classType = semanticModel == null ? Symbols.unknownType : semanticModel.getClassType(signature.substring(0, signature.indexOf('#'))); state = currentState.addConstraint(thisSV, ObjectConstraint.NOT_NULL).addConstraint(thisSV, new TypedConstraint(classType)).put(0, thisSV); parameterIdx = 1; } org.objectweb.asm.Type[] argumentTypes = org.objectweb.asm.Type.getArgumentTypes(signature.substring(signature.indexOf('('))); for (org.objectweb.asm.Type argumentType: argumentTypes) { SymbolicValue sv = constraintManager.createSymbolicValue((Instruction) null); methodBehavior.addParameter(sv); state = state.put(parameterIdx, sv); state = setDoubleOrLong(state, sv, argumentType.getSize() == 2); parameterIdx += argumentType.getSize(); } return Collections.singletonList(state); }

Target:
Iterable<ProgramState> startingStates(String signature, ProgramState currentState, boolean isStaticMethod) { int parameterIdx = 0; ProgramState state = currentState; if(!isStaticMethod) { SymbolicValue thisSV = constraintManager.createSymbolicValue((Instruction) null); Type classType = semanticModel.getClassType(signature.substring(0, signature.indexOf('#'))); state = currentState.addConstraint(thisSV, ObjectConstraint.NOT_NULL).addConstraint(thisSV, new TypedConstraint(classType)).put(0, thisSV); parameterIdx = 1; } org.objectweb.asm.Type[] argumentTypes = org.objectweb.asm.Type.getArgumentTypes(signature.substring(signature.indexOf('('))); for (org.objectweb.asm.Type argumentType: argumentTypes) { SymbolicValue sv = constraintManager.createSymbolicValue((Instruction) null); methodBehavior.addParameter(sv); state = state.put(parameterIdx, sv); state = setDoubleOrLong(state, sv, argumentType.getSize() == 2); parameterIdx += argumentType.getSize(); } return Collections.singletonList(state); }
Source:
private int getSleepTimeMs() { int sleepMs = base_sleep_ms * Math.max(1, Math.min(1, random.nextInt(1 << retries.get()))); if ( sleepMs > max_sleep_ms ) sleepMs = max_sleep_ms; if ( sleepMs < base_sleep_ms ) sleepMs = base_sleep_ms; return sleepMs; }

Target:
private int getSleepTimeMs() { int backoff = 1 << Math.max(1, retries.get()); int sleepMs = base_sleep_ms * Math.max(1, random.nextInt(backoff)); if ( sleepMs > max_sleep_ms ) sleepMs = max_sleep_ms; if ( sleepMs < base_sleep_ms ) sleepMs = base_sleep_ms; return sleepMs; }
Source:
public void sms_send(String id, String destination, String content) { try { smsSender.send(id, destination, content); } catch(Exception ex) { logException(ex); } }

Target:
public void sms_send(String id, String destination, String content) throws Exception { try { smsSender.send(id, destination, content); } catch(Exception ex) { logException(ex); throw ex; } }
Source:
public List<AttributeDTO> getAttributesByGidAndAttributeIds( final String gid, final List<String> attributeIds, final Integer pageSize, final Integer pageNumber) { final List<AttributeDTO> attributes = Lists.newArrayList(); try { String sql = "SELECT " + " u.fcode AS attributeCode," + " u.fldno AS attributeDbId," + " u.fname AS attributeName," + " a.adate AS determinedDate," + " a.aval AS value " + " FROM" + " atributs a" + " INNER JOIN" + " udflds u ON a.atype = u.fldno " + " WHERE" + " a.gid = :gid AND u.ftable = 'ATRIBUTS'"; if (attributeIds != null && !attributeIds.isEmpty()) { sql = sql + " AND u.fldno IN ( :attributs )"; } final SQLQuery query = this.getSession().createSQLQuery(sql); query.addScalar("attributeCode").addScalar("attributeDbId").addScalar("attributeName").addScalar("determinedDate") .addScalar("value"); query.setParameter("gid", gid); if (attributeIds != null && !attributeIds.isEmpty()) { query.setParameterList("attributs", attributeIds); } if (pageNumber != null && pageSize != null) { query.setFirstResult(pageSize * (pageNumber - 1)); query.setMaxResults(pageSize); } final List<Object> results = query.list(); for (final Object o : results) { final Object[] result = (Object[]) o; if (result != null) { final AttributeDTO attributeDTO = new AttributeDTO(); attributeDTO.setAttributeCode((String) result[0]); attributeDTO.setAttributeDbId((Integer) result[1]); attributeDTO.setAttributeName((String) result[2]); attributeDTO.setDeterminedDate((Integer) result[3]); attributeDTO.setValue((String) result[4]); attributes.add(attributeDTO); } } } catch (final HibernateException e) { throw new MiddlewareQueryException("Error with getAttributesByGid(gidList=" + gid + "): " + e.getMessage(), e); } return attributes; }

Target:
public List<AttributeDTO> getAttributesByGidAndAttributeIds( final String gid, final List<String> attributeIds, final Integer pageSize, final Integer pageNumber) { List<AttributeDTO> attributes; try { String sql = this.buildQueryForAttributes(attributeIds); final SQLQuery query = this.getSession().createSQLQuery(sql); query.addScalar("attributeCode").addScalar("attributeDbId").addScalar("attributeName").addScalar("determinedDate") .addScalar("value"); query.setParameter("gid", gid); if (attributeIds != null && !attributeIds.isEmpty()) { query.setParameterList("attributs", attributeIds); } if (pageNumber != null && pageSize != null) { query.setFirstResult(pageSize * (pageNumber - 1)); query.setMaxResults(pageSize); } query.setResultTransformer(Transformers.aliasToBean(AttributeDTO.class)); attributes = query.list(); } catch (final HibernateException e) { throw new MiddlewareQueryException("Error with getAttributesByGid(gidList=" + gid + "): " + e.getMessage(), e); } return attributes; }
Source:
public static ClockSkewMonitor create(Set<String> remoteServers, Optional<SSLSocketFactory> optionalSecurity) { Map<String, ClockService> monitors = Maps.toMap(remoteServers, (remoteServer) -> AtlasDbHttpClients.createProxy(optionalSecurity, remoteServer, ClockService.class)); Map<String, RequestTime> previousRequests = Maps.newHashMap(); for (String server : remoteServers) { previousRequests.put(server, RequestTime.EMPTY); } return new ClockSkewMonitor(monitors, previousRequests, new ClockSkewEvents(AtlasDbMetrics.getMetricRegistry()), Executors.newSingleThreadScheduledExecutor(), new ClockServiceImpl()); }

Target:
public static ClockSkewMonitor create(Set<String> remoteServers, Optional<SSLSocketFactory> optionalSecurity) { Map<String, ClockService> monitors = Maps.toMap(remoteServers, (remoteServer) -> AtlasDbHttpClients.createProxy(optionalSecurity, remoteServer, ClockService.class)); Map<String, RequestTime> previousRequests = Maps.newHashMap(); for (String server : remoteServers) { previousRequests.put(server, RequestTime.EMPTY); } return new ClockSkewMonitor(monitors, previousRequests, new ClockSkewEvents(AtlasDbMetrics.getMetricRegistry()), Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("clock-skew-monitor", true)), new ClockServiceImpl()); }
Source:
private void setFileTrackingInfo(BatchSourceContext context, Configuration conf) throws IOException { String tableName = this.config.tableName; if (StringUtils.isNotEmpty(tableName)) { try { processedFileTrackingTable = context.getDataset(tableName); if (processedFileTrackingTable != null) { List<String> processedFiles = new ArrayList<String>(); File tempFile = new File(tableName); if (tempFile.exists()) { tempFile.delete(); } tempFile.createNewFile(); CloseableIterator<KeyValue<byte[], byte[]>> iterator = processedFileTrackingTable.scan(null, null); while (iterator.hasNext()) { KeyValue<byte[], byte[]> keyValue = iterator.next(); processedFiles.add(new String(keyValue.getKey(), Charsets.UTF_8)); } conf.set(XMLInputFormat.XML_INPUTFORMAT_PROCESSED_DATA_TEMP_FILE, tableName); if (config.reprocessingReq.equalsIgnoreCase("NO")) { conf.set(XMLInputFormat.XML_INPUTFORMAT_PROCESSED_FILES, GSON.toJson(processedFiles, ARRAYLIST_PREPROCESSED_FILES)); } } } catch (DatasetInstantiationException datasetInstantiationException) { throw Throwables.propagate(datasetInstantiationException); } } }

Target:
private void setFileTrackingInfo(BatchSourceContext context, Configuration conf) { processedFileTrackingTable = context.getDataset(config.tableName); if (processedFileTrackingTable != null && !config.isReprocessingRequired()) { List<String> processedFiles = new ArrayList<String>(); Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, -Integer.valueOf(config.tableExpiryPeriod)); Date expiryDate = cal.getTime(); try (CloseableIterator<KeyValue<byte[], byte[]>> iterator = processedFileTrackingTable.scan(null, null)) { while (iterator.hasNext()) { KeyValue<byte[], byte[]> keyValue = iterator.next(); Long time = Bytes.toLong(keyValue.getValue()); Date processedDate = new Date(time); if (processedDate.before(expiryDate)) { processedFileTrackingTable.delete(keyValue.getKey()); } else { processedFiles.add(Bytes.toString(keyValue.getKey())); } } } conf.set(XMLInputFormat.XML_INPUTFORMAT_PROCESSED_FILES, GSON.toJson(processedFiles, ARRAYLIST_PREPROCESSED_FILES)); } }
Source:
private int getFakePort(String sniServerName) { fakePorts.addIfAbsent(sniServerName); return fakePorts.indexOf(sniServerName); }

Target:
private int getFakePort(String sniServerName) { fakePorts.addIfAbsent(sniServerName); return FAKE_PORT_OFFSET + fakePorts.indexOf(sniServerName); }
Source:
public Optional<List<String>> getAllViews(String databaseName) { try { return retry() .stopOn(UnknownDBException.class) .stopOnIllegalExceptions() .run("getAllViews", stats.getGetAllViews().wrap(() -> { try (HiveMetastoreClient client = clientProvider.createMetastoreClient()) { String filter = HIVE_FILTER_FIELD_PARAMS + PRESTO_VIEW_FLAG + " = \"true\""; return Optional.of(client.getTableNamesByFilter(databaseName, filter)); } })); } catch (UnknownDBException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }

Target:
public Optional<List<String>> getAllViews(String databaseName) { try { return retry() .stopOn(UnknownDBException.class) .stopOnIllegalExceptions() .run("getAllViews", stats.getGetAllViews().wrap(() -> wrapMetastoreCallable((HiveMetastoreClient client, ThriftHiveMetastoreStats stat) -> stat.getGetAllViews().wrapCall(() -> { String filter = HIVE_FILTER_FIELD_PARAMS + PRESTO_VIEW_FLAG + " = \"true\""; return Optional.of(client.getTableNamesByFilter(databaseName, filter)); })))); } catch (UnknownDBException e) { return Optional.empty(); } catch (TException e) { throw new PrestoException(HIVE_METASTORE_ERROR, e); } catch (Exception e) { throw propagate(e); } }
Source:
public void visit(LwM2mResource resource) { LOG.trace("Encoding resource into SenML JSON", resource); if (!requestPath.isResource()) { throw new CodecException("Invalid request path %s for resource encoding", requestPath); } lwM2mResourceToSenMLRecord(EMPTY_RESOURCE_PATH, timestamp, resource); }

Target:
public void visit(LwM2mResource resource) { LOG.trace("Encoding resource into SenML JSON", resource); if (!requestPath.isResource()) { throw new CodecException("Invalid request path %s for resource encoding", requestPath); } lwM2mResourceToSenMLRecord(null, resource); }
Source:
public int partition(final Event event) { crcGenerator.reset(); crcGenerator.update(event.getHost().getBytes()); return (int) crcGenerator.getValue(); }

Target:
public int partition(final Event event) { final CRC32 crcGenerator = new CRC32(); crcGenerator.update(event.getHost().getBytes()); return (int) crcGenerator.getValue(); }
Source:
public char getIgnoreWhitespace() { return ignoreWhitespace; }

Target:
public Whitespace getIgnoreWhitespace() { return Whitespace.forCode(ignoreWhitespace); }
Source:
public List<String> fetch() { ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource(filename).getFile()); if (isDirty(file.lastModified())) { System.out.println(filename + " is dirty! Re-fetching file content..."); List<String> data = new ArrayList<String>(); try (BufferedReader br = new BufferedReader(new FileReader(file))) { String line; while ((line = br.readLine()) != null) { data.add(line); } } catch (IOException e) { e.printStackTrace(); } return data; } return null; }

Target:
public List<String> fetch() { ClassLoader classLoader = getClass().getClassLoader(); File file = new File(classLoader.getResource(filename).getFile()); if (isDirty(file.lastModified())) { System.out.println(filename + " is dirty! Re-fetching file content..."); List<String> data = new ArrayList<String>(); try (BufferedReader br = new BufferedReader(new FileReader(file))) { String line; while ((line = br.readLine()) != null) { data.add(line); } } catch (IOException e) { e.printStackTrace(); } return data; } return new ArrayList<String>(); }
Source:
protected void customizeTemplate(ConfigBag setup, ComputeService computeService, Template template) { for (JcloudsLocationCustomizer customizer : getCustomizers(setup)) { customizer.customize(this, computeService, template); customizer.customize(this, computeService, template.getOptions()); } if (template.getOptions() instanceof SoftLayerTemplateOptions) { SoftLayerTemplateOptions slT = ((SoftLayerTemplateOptions)template.getOptions()); if (Strings.isBlank(slT.getDomainName()) || "jclouds.org".equals(slT.getDomainName())) { slT.domainName("local.brooklyncentral.org"); } Map<String, String> md = slT.getUserMetadata(); if (md!=null && !md.isEmpty()) { Set<String> tags = MutableSet.copyOf(slT.getTags()); for (Map.Entry<String,String> entry: md.entrySet()) { tags.add(AbstractCloudMachineNamer.sanitize(entry.getKey())+":"+AbstractCloudMachineNamer.sanitize(entry.getValue())); } slT.tags(tags); if (!md.containsKey("notes")) { String notes = "User Metadata\n=============\n\n * " + Joiner.on("\n * ").withKeyValueSeparator(": ").join(md); if (notes.length() > NOTES_MAX_LENGTH) { String truncatedMsg = "...\n<truncated>"; notes = notes.substring(0, NOTES_MAX_LENGTH - truncatedMsg.length()) + truncatedMsg; } md.put("notes", notes); } } } }

Target:
protected void customizeTemplate(ConfigBag setup, ComputeService computeService, Template template) { for (JcloudsLocationCustomizer customizer : getCustomizers(setup)) { customizer.customize(this, computeService, template); customizer.customize(this, computeService, template.getOptions()); } if (template.getOptions() instanceof SoftLayerTemplateOptions) { SoftLayerTemplateOptions slT = ((SoftLayerTemplateOptions)template.getOptions()); if (Strings.isBlank(slT.getDomainName()) || "jclouds.org".equals(slT.getDomainName())) { slT.domainName("local.brooklyncentral.org"); } Map<String, String> md = slT.getUserMetadata(); if (md!=null && !md.isEmpty()) { Set<String> tags = MutableSet.copyOf(slT.getTags()); for (Map.Entry<String,String> entry: md.entrySet()) { tags.add(AbstractCloudMachineNamer.sanitize(entry.getKey())+":"+AbstractCloudMachineNamer.sanitize(entry.getValue())); } slT.tags(tags); if (!md.containsKey("notes")) { String notes = "User Metadata\n=============\n\n * " + Joiner.on("\n * ").withKeyValueSeparator(": ").join(md); if (notes.length() > NOTES_MAX_LENGTH) { String truncatedMsg = "...\n<truncated - notes total length is " + notes.length() + " characters>"; notes = notes.substring(0, NOTES_MAX_LENGTH - truncatedMsg.length()) + truncatedMsg; } md.put("notes", notes); } } } }
Source:
static public Set<String> parseProtocolRequestHeader(String value) { if (StringUtils.isEmpty(value)) { return null; } Set<String> subprotocols = new LinkedHashSet<>(); if (!StringUtils.isEmpty(value)) { String[] values = value.split(","); for (String v : values) { subprotocols.add(v.trim()); } } return subprotocols; }

Target:
static public Set<String> parseProtocolRequestHeader(String value) { Set<String> subprotocols = new LinkedHashSet<>(); if (!StringUtils.isEmpty(value)) { String[] values = value.split(","); for (String v : values) { subprotocols.add(v.trim()); } } return subprotocols; }
Source:
private synchronized void logMostLikelyMissedJobs(List<JobDescriptor> jobs) { Date now = new Date(); jobs.stream() .map(jobDescriptor -> ((JobDescriptorImpl) jobDescriptor).getInternal()) .filter(job -> job.getJobDeadline().isPresent()) .filter(job -> job.getJobInfo().getStartTime() < 0) .filter(job -> { Date deadline = getEffectiveDeadline(job); Date expeFinish = getEffectiveExpectedExecutionTime(job, now); return deadline.compareTo(expeFinish) < 0; }) .forEach(job -> { if (!alreadyNotified.contains(job.getId())) { final Date expectedFinishingTime = getEffectiveExpectedExecutionTime(job, now); final Date effectiveDeadline = getEffectiveDeadline(job); LOGGER.warn(String.format("Job[id=%s] will most likely miss its deadline (expected finish: %s, after deadline: %s)", job.getId().value(), expectedFinishingTime, effectiveDeadline)); JobMostLikelyMissedEmailNotification notificationSender; if (job.getJobExpectedExecutionTime().isPresent()) { notificationSender = new JobMostLikelyMissedEmailNotification(job, expectedFinishingTime, effectiveDeadline, job.getJobExpectedExecutionTime() .get()); } else { notificationSender = new JobMostLikelyMissedEmailNotification(job, expectedFinishingTime, effectiveDeadline); } notificationSender.checkAndSend(); alreadyNotified.add(job.getId()); } }); }

Target:
private synchronized void logMostLikelyMissedJobs(List<JobDescriptor> jobs) { Date now = new Date(); jobs.stream() .map(jobDescriptor -> ((JobDescriptorImpl) jobDescriptor).getInternal()) .filter(job -> job.getJobDeadline().isPresent()) .filter(job -> !job.getJobInfo().isStarted()) .filter(job -> { Date deadline = getDeadlineAsAbsoluteDate(job); Date finishingTime = getFinishingTimeIfJobStartedNow(job, now); return deadline.compareTo(finishingTime) < 0; }) .forEach(job -> { if (!alreadyNotified.contains(job.getId())) { alreadyNotified.add(job.getId()); final Date deadline = getDeadlineAsAbsoluteDate(job); final Date finishingTime = getFinishingTimeIfJobStartedNow(job, now); LOGGER.warn(String.format("Job[id=%s] will most likely miss its deadline (expected finish: %s is after deadline: %s)", job.getId().value(), finishingTime, deadline)); JobMostLikelyMissedEmailNotification notificationSender; if (job.getJobExpectedExecutionTime().isPresent()) { notificationSender = new JobMostLikelyMissedEmailNotification(job, finishingTime, deadline, job.getJobExpectedExecutionTime() .get()); } else { notificationSender = new JobMostLikelyMissedEmailNotification(job, finishingTime, deadline); } notificationSender.tryToSend(); } }); }
Source:
public void init() { dependencyPagedJarTable = IOC.getBeanManager().lookupBean(DependencyListWidget.class).getInstance(); dependencyPagedJarTable.addOnSelect(parameter -> { presenter.onPathSelection(parameter); lockRequired.fire(new LockRequiredEvent()); }); setTitle("Artifacts"); setBody(dependencyPagedJarTable); setSize(ModalSize.LARGE); addShownHandler(shownEvent -> dependencyPagedJarTable.search()); }

Target:
public void init() { dependencyPagedJarTable = dependencyPagedJarTables.get(); dependencyPagedJarTable.addOnSelect(parameter -> { presenter.onPathSelection(parameter); lockRequired.fire(new LockRequiredEvent()); }); setTitle("Artifacts"); setBody(dependencyPagedJarTable); setSize(ModalSize.LARGE); addShownHandler(shownEvent -> dependencyPagedJarTable.search()); }
Source:
public void testInstantiateAuthorizationHandler() { GoogleCloudStorageOptions options = GoogleCloudStorageOptions.builder() .setAppName("test-name") .setProjectId("test-project") .setAuthorizationHandler(TestConfAuthorizationHandler.class) .setAuthorizationHandlerProperties( new HashMap<String, String>() { { put( TestConfAuthorizationHandler.PROPERTY_KEY, TestConfAuthorizationHandler.EXPECTED_VALUE); } }) .build(); StorageRequestAuthorizer authorizer = initializeAuthorizationHandler(options); assertThat(authorizer).isNotNull(); }

Target:
public void testInstantiateAuthorizationHandler() throws ReflectiveOperationException { GoogleCloudStorageOptions options = GoogleCloudStorageOptions.builder() .setAppName("test-name") .setProjectId("test-project") .setAuthorizationHandlerClass(TestConfAuthorizationHandler.class) .setAuthorizationHandlerProperties( ImmutableMap.of( TestConfAuthorizationHandler.PROPERTY_KEY, TestConfAuthorizationHandler.EXPECTED_VALUE)) .build(); StorageRequestAuthorizer authorizer = initializeStorageRequestAuthorizer(options); assertThat(authorizer).isNotNull(); }
Source:
public void testBadCallback() throws Exception { ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; Arrays.fill(serverErrorCodes, ServerErrorCode.No_Error); presetServerErrorCode(serverErrorCodes); final CountDownLatch callbackCalled = new CountDownLatch(1); router.deleteBlob(blobIdString, new Callback<Void>() { @Override public void onCompletion(Void result, Exception exception) { callbackCalled.countDown(); throw new RuntimeException("Throwing an exception in the user callback"); } }).get(); Assert.assertTrue("Callback not called.", callbackCalled.await(2, TimeUnit.SECONDS)); Assert.assertEquals("All operations should be finished.", 0, router.getOperationsCount()); Assert.assertTrue("Router should not be closed", router.isOpen()); future = router.deleteBlob(blobIdString, new ClientCallback()); future.get(); }

Target:
public void testBadCallback() throws Exception { ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; Arrays.fill(serverErrorCodes, ServerErrorCode.No_Error); presetServerErrorCode(serverErrorCodes); final CountDownLatch callbackCalled = new CountDownLatch(1); List<Future> futures = new ArrayList<>(); for (int i = 0; i < 5; i++) { if (i == 1) { futures.add(router.deleteBlob(blobIdString, new Callback<Void>() { @Override public void onCompletion(Void result, Exception exception) { callbackCalled.countDown(); throw new RuntimeException("Throwing an exception in the user callback"); } })); } else { futures.add(router.deleteBlob(blobIdString)); } } for (Future future : futures) { future.get(); } Assert.assertTrue("Callback not called.", callbackCalled.await(2, TimeUnit.SECONDS)); Assert.assertEquals("All operations should be finished.", 0, router.getOperationsCount()); Assert.assertTrue("Router should not be closed", router.isOpen()); router.deleteBlob(blobIdString, new ClientCallback()).get(); Assert.assertTrue("Callback not called.", operationCompleteLatch.await(2, TimeUnit.SECONDS)); }
Source:
private boolean hasCnxSASLAuthenticated(ServerCnxn cnxn) { for (Id id : cnxn.getAuthInfo()) { if (id.getScheme().equals("sasl")) { return true; } } return false; }

Target:
private boolean hasCnxSASLAuthenticated(ServerCnxn cnxn) { for (Id id : cnxn.getAuthInfo()) { if (id.getScheme().equals(SASL_AUTH_SCHEME)) { return true; } } return false; }
Source:
protected CliGitAPIImpl(String gitExe, File workspace, TaskListener listener, EnvVars environment) { super(workspace); this.listener = listener; this.gitExe = gitExe; this.environment = environment; this.encoding = isZos() && System.getProperty("ibm.system.encoding")!=null ? Charset.forName(System.getProperty("ibm.system.encoding")).toString() : Charset.defaultCharset().toString(); launcher = new LocalLauncher(IGitAPI.verbose ? listener : TaskListener.NULL); }

Target:
protected CliGitAPIImpl(String gitExe, File workspace, TaskListener listener, EnvVars environment) { super(workspace); this.listener = listener; this.gitExe = gitExe; this.environment = environment; if( isZos() && System.getProperty("ibm.system.encoding") != null ) { this.encoding = Charset.forName(System.getProperty("ibm.system.encoding")).toString(); } else { this.encoding = Charset.defaultCharset().toString(); } launcher = new LocalLauncher(IGitAPI.verbose ? listener : TaskListener.NULL); }
Source:
public Iterable<Object> loadObjects(EntityProjection entityProjection, RequestScope scope) { Query query = buildQuery(entityProjection, scope); queryResult = queryEngine.executeQuery(query); queryResult.run(); try { QueryResult result = queryResult.get(); if (entityProjection.getPagination() != null && entityProjection.getPagination().returnPageTotals()) { entityProjection.getPagination().setPageTotals(result.getPageTotals()); } return result.getData(); } catch (TransactionException e) { throw new TransactionException(null); } catch (InterruptedException e) { throw new IllegalStateException(e); } catch (ExecutionException e) { throw new IllegalStateException(e); } }

Target:
public Iterable<Object> loadObjects(EntityProjection entityProjection, RequestScope scope) { Query query = buildQuery(entityProjection, scope); QueryResult result = null; String cacheKey = null; if (cache != null && !query.isBypassingCache()) { String tableVersion = queryEngine.getTableVersion(query.getTable(), queryEngineTransaction); if (tableVersion != null) { cacheKey = tableVersion + ';' + QueryKeyExtractor.extractKey(query); result = cache.get(cacheKey); } } if (result == null) { result = queryEngine.executeQuery(query, queryEngineTransaction); if (cacheKey != null) { cache.put(cacheKey, result); } } if (entityProjection.getPagination() != null && entityProjection.getPagination().returnPageTotals()) { entityProjection.getPagination().setPageTotals(result.getPageTotals()); } return result.getData(); }
Source:
private void parseInternalVars(final BaseFBType type) throws TypeImportException, XMLStreamException { processChildren(LibraryElementTags.INTERNAL_VARS_ELEMENT, name -> { if (name.equals(LibraryElementTags.VAR_DECLARATION_ELEMENT)) { VarDeclaration v = parseVarDeclaration(); type.getInternalVars().add(v); return true; } return false; }); }

Target:
private void parseInternalVars(final BaseFBType type) throws TypeImportException, XMLStreamException { processChildren(LibraryElementTags.INTERNAL_VARS_ELEMENT, name -> { if (LibraryElementTags.VAR_DECLARATION_ELEMENT.equals(name)) { VarDeclaration v = parseVarDeclaration(); type.getInternalVars().add(v); return true; } return false; }); }
Source:
protected void configure() { bind(TypeMappings.class, JavaTypeMappings.class); bind(QueryTypeFactory.class, QueryTypeFactoryImpl.class); bind(EntitySerializer.class); bind(EmbeddableSerializer.class); bind(ProjectionSerializer.class); bind(SupertypeSerializer.class); bind(String.class); bind(PREFIX, "Q"); bind(SUFFIX, ""); bind(PACKAGE_SUFFIX, ""); bind(KEYWORDS, Collections.<String>emptySet()); bind(IMPORTS, Collections.<String>emptySet()); bind(QUERYDSL_VARIABLE_NAME_FUNCTION_CLASS, DefaultVariableNameFunction.class.getCanonicalName()); }

Target:
protected void configure() { bind(TypeMappings.class, JavaTypeMappings.class); bind(QueryTypeFactory.class, QueryTypeFactoryImpl.class); bind(EntitySerializer.class); bind(EmbeddableSerializer.class); bind(ProjectionSerializer.class); bind(SupertypeSerializer.class); bind(PREFIX, "Q"); bind(SUFFIX, ""); bind(PACKAGE_SUFFIX, ""); bind(KEYWORDS, Collections.<String>emptySet()); bind(IMPORTS, Collections.<String>emptySet()); bind(VARIABLE_NAME_FUNCTION_CLASS, new DefaultVariableNameFunction()); bind(CASE_TRANSFORMER_CLASS, UncapitalizedCaseTransformer.class.getCanonicalName()); }
Source:
public Queue getDlcQueue() throws AndesAdminServiceBrokerManagerAdminException, java.rmi.RemoteException { Queue[] queueList = stub.getAllQueues(); Queue dlcQueue = null; if (queueList != null) { for (Queue queue : queueList) { String nameOfQueue = queue.getQueueName(); if (nameOfQueue != null && nameOfQueue.contains("DeadLetterChannel")) { dlcQueue = queue; break; } } } return dlcQueue; }

Target:
public Queue getDlcQueue() throws AndesAdminServiceBrokerManagerAdminException, java.rmi.RemoteException { Queue[] queueList = stub.getAllQueues(); Queue dlcQueue = null; if (null != queueList) { for (Queue queue : queueList) { String nameOfQueue = queue.getQueueName(); if (StringUtils.isNotBlank(nameOfQueue) && nameOfQueue.contains( AndesConstants.DEAD_LETTER_QUEUE_SUFFIX)) { dlcQueue = queue; break; } } } return dlcQueue; }